I often compile the stack in C++ (g++ in linux or /TP in MSVC) for better type-checking, in which case the #ifdef limits the scope of this.
(Typically I search&replace cplusplus with cplusplus_something_else to disable the protection.)
cplusplus is useful for libraries where the library source is unavailable. All projects using your stack have all the source available, so there is no need for this...
Anyone else wish to comment?
Ed
bitsissue00001
Last edit: Edward Hague 2016-02-08
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The extern "C" is used to prevent name mangling when using the library as a C library along with C++ code. I use this technique when mixing with C++ - even when I have source - or the C files cannot link to the C functions in other C files.
Perhaps adding another define would suffice for your project?
Steve
May I suggest removal of all
from the stack?
I often compile the stack in C++ (g++ in linux or /TP in MSVC) for better type-checking, in which case the #ifdef limits the scope of this.
(Typically I search&replace cplusplus with cplusplus_something_else to disable the protection.)
cplusplus is useful for libraries where the library source is unavailable. All projects using your stack have all the source available, so there is no need for this...
Anyone else wish to comment?
Ed
bitsissue00001
Last edit: Edward Hague 2016-02-08
The extern "C" is used to prevent name mangling when using the library as a C library along with C++ code. I use this technique when mixing with C++ - even when I have source - or the C files cannot link to the C functions in other C files.
Perhaps adding another define would suffice for your project?