Skip to content

Instantly share code, notes, and snippets.

@tomdaley92
Created December 19, 2018 00:25
Show Gist options
  • Save tomdaley92/5aac4a5635798ec482c78f60600a7cd8 to your computer and use it in GitHub Desktop.
Save tomdaley92/5aac4a5635798ec482c78f60600a7cd8 to your computer and use it in GitHub Desktop.
Prevent name mangling of C code with C++ compiler
#ifdef __cplusplus
extern "C" {
#endif
/* Declarations of this file */
#ifdef __cplusplus
}
#endif
@tomdaley92
Copy link
Author

tomdaley92 commented Dec 19, 2018

The entire contents of the header file would go where the comment goes.

Some more useful information:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment