Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1687)

Unified Diff: mojo/public/c/system/macros.h

Issue 1807613002: Add MOJO_{BEGIN,END}_EXTERN_C macros, and use them. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: asdf Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/public/c/system/handle.h ('k') | mojo/public/c/system/main.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/c/system/macros.h
diff --git a/mojo/public/c/system/macros.h b/mojo/public/c/system/macros.h
index 5f0040cac8cffef3223b480532da8e7c3dfea5d9..8a4916ade9a9ef13e42eb8c474706e06963563cd 100644
--- a/mojo/public/c/system/macros.h
+++ b/mojo/public/c/system/macros.h
@@ -62,4 +62,14 @@
#error "Please define MOJO_ALIGNAS() for your compiler."
#endif
+// Use these to declare functions in C header files so that they'll be usable
+// from C++.
+#if defined(__cplusplus)
+#define MOJO_BEGIN_EXTERN_C extern "C" {
+#define MOJO_END_EXTERN_C }
+#else
+#define MOJO_BEGIN_EXTERN_C
+#define MOJO_END_EXTERN_C
+#endif
+
#endif // MOJO_PUBLIC_C_SYSTEM_MACROS_H_
« no previous file with comments | « mojo/public/c/system/handle.h ('k') | mojo/public/c/system/main.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698