Also drop support for very old compilers, and activate priorities on Mac too
(hoping that it works correctly nowadays).
/* xbt.h - Public interface to the xbt (simgrid's toolbox) */
/* xbt.h - Public interface to the xbt (simgrid's toolbox) */
-/* Copyright (c) 2004-2017. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2004-2018. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
#define XBT_ATTRIB_DEPRECATED_v320(msg) XBT_ATTRIB_DEPRECATED(msg) /* Will be dropped in v3.20 */
#define XBT_ATTRIB_DEPRECATED_v321(msg) XBT_ATTRIB_DEPRECATED(msg) /* Will be dropped in v3.21 */
#define XBT_ATTRIB_DEPRECATED_v320(msg) XBT_ATTRIB_DEPRECATED(msg) /* Will be dropped in v3.20 */
#define XBT_ATTRIB_DEPRECATED_v321(msg) XBT_ATTRIB_DEPRECATED(msg) /* Will be dropped in v3.21 */
-/* Constructor priorities exist since gcc 4.3. Apparently, they are however not
- * supported on Macs. */
-#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) && !defined(__APPLE__)
-# define _XBT_GNUC_CONSTRUCTOR(prio) __attribute__((__constructor__ (prio)))
-# define _XBT_GNUC_DESTRUCTOR(prio) __attribute__((__destructor__ (prio)))
-#else
-# define _XBT_GNUC_CONSTRUCTOR(prio) __attribute__((__constructor__))
-# define _XBT_GNUC_DESTRUCTOR(prio) __attribute__((__destructor__))
-#endif
+#define XBT_ATTRIB_CONSTRUCTOR(prio) __attribute__((__constructor__(prio)))
+#define XBT_ATTRIB_DESTRUCTOR(prio) __attribute__((__destructor__(prio)))
#if defined(__GNUC__)
# define XBT_ALWAYS_INLINE inline __attribute__ ((always_inline))
#if defined(__GNUC__)
# define XBT_ALWAYS_INLINE inline __attribute__ ((always_inline))
/* log - a generic logging facility in the spirit of log4j */
/* log - a generic logging facility in the spirit of log4j */
-/* Copyright (c) 2004-2017. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2004-2018. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
#if defined(__GNUC__) && defined(__APPLE__)
# define _XBT_LOGV_CTOR_ATTRIBUTE
#else
#if defined(__GNUC__) && defined(__APPLE__)
# define _XBT_LOGV_CTOR_ATTRIBUTE
#else
-# define _XBT_LOGV_CTOR_ATTRIBUTE _XBT_GNUC_CONSTRUCTOR(600)
+# define _XBT_LOGV_CTOR_ATTRIBUTE XBT_ATTRIB_CONSTRUCTOR(600)
#endif
/* The root of the category hierarchy. */
#endif
/* The root of the category hierarchy. */
-/* Copyright (c) 2010-2017. The SimGrid Team.
+/* Copyright (c) 2010-2018. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
/** Constructor functions used to initialize the malloc implementation
*/
/** Constructor functions used to initialize the malloc implementation
*/
-_XBT_GNUC_CONSTRUCTOR(101) static void mm_legacy_constructor()
+XBT_ATTRIB_CONSTRUCTOR(101) static void mm_legacy_constructor()
{
if (mm_initialized)
return;
{
if (mm_initialized)
return;
-/* Copyright (c) 2006-2017. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2006-2018. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
/* Declare xbt_preinit and xbt_postexit as constructor/destructor of the library.
* This is crude and rather compiler-specific, unfortunately.
*/
/* Declare xbt_preinit and xbt_postexit as constructor/destructor of the library.
* This is crude and rather compiler-specific, unfortunately.
*/
-static void xbt_preinit() _XBT_GNUC_CONSTRUCTOR(200);
+static void xbt_preinit() XBT_ATTRIB_CONSTRUCTOR(200);
static void xbt_postexit();
#ifdef _WIN32
static void xbt_postexit();
#ifdef _WIN32