Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Apparently, constructor priorities are not supported on Macs.
[simgrid.git] / include / xbt / misc.h
index ed4bc8ac6e7bc409b35528c52a64b7395f4eee2f..314dd88a43a409a894b93b3f4fb9dbf13b43d9b4 100644 (file)
               __attribute__((__format__ (__scanf__, format_idx, arg_idx)))
 # define _XBT_GNUC_NORETURN __attribute__((__noreturn__))
 # define _XBT_GNUC_UNUSED  __attribute__((__unused__))
               __attribute__((__format__ (__scanf__, format_idx, arg_idx)))
 # define _XBT_GNUC_NORETURN __attribute__((__noreturn__))
 # define _XBT_GNUC_UNUSED  __attribute__((__unused__))
-# define _XBT_GNUC_CONSTRUCTOR(prio) __attribute__((__constructor__ (prio)))
-# define _XBT_GNUC_DESTRUCTOR(prio) __attribute__((__destructor__ (prio)))
+/* Apparently, constructor priorities are not supported on Macs */
+# if APPLE
+#  define _XBT_GNUC_CONSTRUCTOR(prio) __attribute__((__constructor__))
+#  define _XBT_GNUC_DESTRUCTOR(prio) __attribute__((__destructor__))
+# else
+#  define _XBT_GNUC_CONSTRUCTOR(prio) __attribute__((__constructor__ (prio)))
+#  define _XBT_GNUC_DESTRUCTOR(prio) __attribute__((__destructor__ (prio)))
+# endif
 # undef _XBT_NEED_INIT_PRAGMA
 
 #else                           /* !__GNUC__ */
 # undef _XBT_NEED_INIT_PRAGMA
 
 #else                           /* !__GNUC__ */