
On 3/25/2011 5:05 AM, John Maddock wrote:
Almost certainly :-(
What in config is C++ specific as opposed to C as far as the actual header file code ?
Well some of the detection code needs to include C++ only headers... but I guess we wouldn't need to configure the C++ std lib in C mode ?!
There are also a few C++ specific workarounds in suffix.hpp, but they could be included in a #ifdef __cplusplus block.
I am working on bringing my variadic macro data library into Boost PP, and I wanted to use the BOOST_NO_VARIADIC_MACROS in config, but Paul Mensonides was concerned that Boost PP should work with a C compiler and that config could have something that is C++ specific, and therefore be unusable for Boost PP. I would rather not reduplicate the logic of BOOST_NO_VARIADIC_MACROS in Boost PP, even though I was the one to add it to config, because it puts the same code in two different places.
We could try and patch Boost.Config to make it C compatible I guess... not sure how much work it would be though?
I am not concerned about the tests themselves, but rather about the header files. If there are C++ specific things in the header files which could just as easily work with C, I would like to take a look at what they are. if it was reasonable work, I could try to convert it as long as it does not affect anything in C++ negatively and was not essentially a "hack" to fit C++ into C.
If you're willing to give it a go, then it's very much a case of add a C-language test case, and see what breaks.
I am not a big fan of trying to get C, as opposed to C++, to work in Boost in general, but it does seem as if the config files could benefit from this if it could be done, and the pp-lib is meant to work for C compilers as well as C++ according the Paul Mensonides. I will look further at this issue. I will assume that the lack of __cplusplus being defined means that one is compiling in C mode.