KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Possible Duplicate: How to check (via the preprocessor) if a C source file is being compiled as C++ code I'm trying to find a standard macro which will test whether a header file is being compiled as C or as C++. The purpose of this is that the header may be included by either C or C++ code, and must behave slightly differently depending on which. Specifically: In C, I need this to be the code: extern size_t insert (const char*); In C++, I need this to be the code: extern "C" size_t insert (const char*); Additionally, is there a way to avoid putting #ifdef's around every declaration in the header?
Tags (comma-separated)
Save Edits
Cancel