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_ */ |