Convert the Solaris xlocale.c compatibility library from plain C to C++,
and fix the prototype for declared functions in order to fix the build
failures caused by the addition of -std=c++11 to LIBCXX_COMPILE_FLAGS.
The additional flag got propagated to the C file, resulting in error
with strict compilers.
Details
- Reviewers
theraven joerg EricWF - Commits
- rGef634ecddde9: [solaris] Convert the support library to C++ to fix -std=c++11 build
rG376548c34c70: [solaris] Fix iswxdigit_l() support function prototype
rCXX284494: [solaris] Convert the support library to C++ to fix -std=c++11 build
rCXX284493: [solaris] Fix iswxdigit_l() support function prototype
rL284494: [solaris] Convert the support library to C++ to fix -std=c++11 build
rL284493: [solaris] Fix iswxdigit_l() support function prototype
Diff Detail
- Repository
- rL LLVM
Event Timeline
It sounds as if the bug here is either that the .c files are being treated as c++, or that we're sticking -std=c++{whatever} in CFLAGS as well as CXXFLAGS. This is probably the bug that should be fixed.
We're sticking them into LIBCXX_COMPILE_FLAGS, to be more precise. And this is the only C file in the whole libcxx, so I'm not sure if anyone even remember about that ;-).
Why not just compile the sources files as C++ by changing their extensions? This change seems all kinds of wrong because we're throwing away *all* of our flags, including things like -m32 or -target <cross-compile-target>.
That's another option. Having a lot of other problems on Solaris at the time, using a separate library was simpler to test. I will try this alternative today.
Ok, here's an updated patch that changes the code to C++. Since C++ is more strict than C, I also had to remove some conflicting declarations -- and while at it, I updated the header to avoid any collisions and redundancy on SunOS 5.11 (OpenIndiana). I don't have access to any older system, and considering that the support for SunOS in clang is still incomplete, I don't think it important to support older systems.
Damn it, it seems that SunOS isn't actually exposing some functions. I need to work on this further, and figure out WTF.
Ok, here's a minimal change necessary to fix the build. I'm not touching anything else not to break it ;-).
Thanks for the review. Committed the prototype fix first, and followed it by the C++ conversion.