summaryrefslogtreecommitdiff
path: root/byterun/misc.h
diff options
context:
space:
mode:
Diffstat (limited to 'byterun/misc.h')
-rw-r--r--byterun/misc.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/byterun/misc.h b/byterun/misc.h
index 2529bc6128..4fd82af2d1 100644
--- a/byterun/misc.h
+++ b/byterun/misc.h
@@ -51,6 +51,14 @@ typedef char * addr;
#define CAMLprim
#define CAMLextern extern
+/* Weak function definitions that can be overriden by external libs */
+/* Conservatively restricted to ELF and MacOSX platforms */
+#if defined(__GNUC__) && (defined (__ELF__) || defined(__APPLE__))
+#define CAMLweakdef __attribute__((weak))
+#else
+#define CAMLweakdef
+#endif
+
/* Assertions */
/* <private> */