Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Rename constructor attribute.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 9 Jan 2018 10:44:18 +0000 (11:44 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 9 Jan 2018 10:44:33 +0000 (11:44 +0100)
Also drop support for very old compilers, and activate priorities on Mac too
(hoping that it works correctly nowadays).

include/xbt/base.h
include/xbt/log.h
src/xbt/mmalloc/mm_legacy.c
src/xbt/xbt_main.cpp

index 93f0491..c33f60a 100644 (file)
@@ -1,6 +1,6 @@
 /* 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))
index 7e86ff8..6e83916 100644 (file)
@@ -1,6 +1,6 @@
 /* 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. */
@@ -90,7 +90,7 @@ typedef enum {
 #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. */
index 5afb74a..8120382 100644 (file)
@@ -1,4 +1,4 @@
-/* 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
@@ -119,7 +119,7 @@ static int mm_initialized;
 
 /** 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;
index 810cd26..85cb4d2 100644 (file)
@@ -1,6 +1,6 @@
 /* module handling                                                          */
 
 /* module handling                                                          */
 
-/* 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. */
@@ -47,7 +47,7 @@ int xbt_pagebits = 0;
 /* 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