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

Unified Diff: native_client_sdk/src/libraries/utils/macros.h

Issue 11190066: [NaCl SDK] nacl-mounts example. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix windows Created 8 years, 1 month 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 | « native_client_sdk/src/libraries/nacl_mounts/kernel_wrap.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: native_client_sdk/src/libraries/utils/macros.h
diff --git a/native_client_sdk/src/libraries/utils/macros.h b/native_client_sdk/src/libraries/utils/macros.h
index 97602b3538ebc1b02dee1a6be584afe295d4f80d..8731e255dd1ac3d30aa23744f562613201611fd3 100644
--- a/native_client_sdk/src/libraries/utils/macros.h
+++ b/native_client_sdk/src/libraries/utils/macros.h
@@ -25,8 +25,25 @@
# define EXTERN_C_END }
#else
# define EXTERN_C_BEGIN
-# define EXEERN_C_END
+# define EXTERN_C_END
#endif /* __cplusplus */
+/**
+ * Macros to help force linkage of symbols that otherwise would not be
+ * included.
+ *
+ * // In a source file that you want to force linkage (file scope):
+ * FORCE_LINK_THIS(myfilename);
+ *
+ * // In a source file that you are sure will be linked (file scope):
+ * FORCE_LINK_THAT(myfilename)
+ *
+ */
+#define FORCE_LINK_THIS(x) int force_link_##x = 0;
+#define FORCE_LINK_THAT(x) \
+ void force_link_function_##x() { \
+ extern int force_link_##x; \
+ force_link_##x = 1; \
+ }
#endif /* LIBRARIES_UTILS_MACROS_H_ */
« no previous file with comments | « native_client_sdk/src/libraries/nacl_mounts/kernel_wrap.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698