If we are on c++03 mode for some reason, and __va_copy is available, then use it instead of error out on not having va_copy in 03 mode.
Details
- Reviewers
hubert.reinterpretcast xingxue daltenty ldionne - Group Reviewers
Restricted Project - Commits
- rGa319eafd160d: [libc++] Provide c++03 alternative for va_copy if available in xlocale.h
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
libcxx/include/__support/ibm/xlocale.h | ||
---|---|---|
314 | This is part of the C standard and should be provided by your implementation. Yes, I know C++03 is technically not built on top of C99 IIRC, but asking your implementation to support it as an extension is the way to go IMO. Using an identifier internal to the specific C library you're using isn't a good solution if there are other alternatives IMO. |
libcxx/include/__support/ibm/xlocale.h | ||
---|---|---|
314 | It might not be a good idea to expose va_copy in non-C99 or above mode because it could pollute user's namespace. |
libcxx/include/__support/ibm/xlocale.h | ||
---|---|---|
314 | This seems reasonable to me, but please add a comment like // va_copy may not be provided by the C library in C++03 mode |
This is part of the C standard and should be provided by your implementation. Yes, I know C++03 is technically not built on top of C99 IIRC, but asking your implementation to support it as an extension is the way to go IMO. Using an identifier internal to the specific C library you're using isn't a good solution if there are other alternatives IMO.