This is indeed possible. You can quite simply do it:
Code: Select all
#ifdef __cplusplus
/* constexpr version */
#else
/* Macro version */
#endif
But, we do not want to break original C code that is dependent on the Macros.
This is why I did the #undef version, as it is in the ch.hpp (after ch.h has been used), so it would not affect the drivers.
On a different note, I have now been testing the wrapper a lot and it seems to work just fine!
I added a few more things to get rid of warnings when compiling in C++14 and merged the patches, see attached patch.
From my side it is ready for first inclusion, and then we can do minor updates as new ideas/features are identified.
