Keil™, An ARM® Company

Discussion Forum

__cplusplus

Next Thread | Thread List | Previous Thread Start a Thread | Settings

DetailsMessage
Read-Only
Author
Raed Abusanad
Posted
26-Nov-2009 13:28 GMT
Toolset
ARM
New! __cplusplus

Hi,,,

How do u read this :

#ifdef __cplusplus
   extern "C" {
#endif
.
.
#ifdef __cplusplus
   }
#endif

#endif


and where __cplusplus is defined?
Thanks

Read-Only
Author
john simbar
Posted
26-Nov-2009 13:54 GMT
Toolset
ARM
New! RE: __cplusplus

__cplusplus is automatically defined when you compile using a C++ compiler.

This is not the case when compiled with a C compiler.

So you can use it to make your code compatible between C and C++.

Next Thread | Thread List | Previous Thread Start a Thread | Settings