Kenneth said:
This tells a C++ compiler that the following is C code, rather than C++.
Actually it doesn't. If you are using a C compiler, the code will
be treated as C, and if you are using a C++ compiler, the code
will be treated as C++.
This directive tells a C++ compiler to generate code that's
compatible with its C ABI, so that C and C++ object files can
subsequently be linked together. Examples of this include
disabling name mangling, and maybe different calling
conventions and structure padding.
Finally, nothing in the C standard prevents a C compiler from
defining __cplusplus, although only the DS9000 would do so.
I've attempted to set follow-ups to comp.lang.c++, because this
stuff is all part of C++ rather than C. I haven't done this before
so I hope it turns out well...