Skip to content

Instantly share code, notes, and snippets.

@daoleno
Created December 11, 2017 07:35
Show Gist options
  • Save daoleno/9031cd653aea5a3e8204f2d0e98775af to your computer and use it in GitHub Desktop.
Save daoleno/9031cd653aea5a3e8204f2d0e98775af to your computer and use it in GitHub Desktop.
mix C and C++

To ensure that the names declared in that portion of code have C linkage, and thus C++ name mangling is not performed

#ifdef __cplusplus
extern "C" {
#endif

void *memset (void *, int, size_t);
char *strcat (char *, const char *);
int   strcmp (const char *, const char *);
char *strcpy (char *, const char *);

#ifdef __cplusplus
}
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment