summaryrefslogtreecommitdiff
path: root/cord
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2017-03-07 18:19:29 +0300
committerIvan Maidanski <ivmai@mail.ru>2017-03-07 18:19:29 +0300
commit4f98587ff5c6f124aa023e170678bfcd884fe042 (patch)
tree7681fd84cd5ea40b2f496c048ff70d33b30344c9 /cord
parentdc590cf006271e42eb4e9b6dfd1c4778696c2d34 (diff)
downloadbdwgc-4f98587ff5c6f124aa023e170678bfcd884fe042.tar.gz
Define CLANG/GNUC_PREREQ macros to check gcc/clang minimum version
(code refactoring) * cord/cordxtra.c (CORD_ATTR_UNUSED): Use GC_GNUC_PREREQ() instead of direct use of __GNUC[_MINOR]__. * gc_cpp.cc (GC_NEW_DELETE_NEED_THROW): Likewise. * include/gc_config_macros.h (GC_API, GC_ATTR_MALLOC, GC_ATTR_ALLOC_SIZE, GC_ATTR_NONNULL, GC_ATTR_DEPRECATED, GC_RETURN_ADDR, GC_RETURN_ADDR_PARENT, GC_PTHREAD_EXIT_ATTRIBUTE): Likewise. * include/gc_cpp.h (GC_NO_OPERATOR_NEW_ARRAY): Likewise. * include/gc_inline.h (GC_EXPECT, GC_PREFETCH_FOR_WRITE): Likewise. * include/new_gc_alloc.h: Likewise. * include/private/gc_priv.h (GC_INNER, GC_ATTR_UNUSED, EXPECT, GC_INLINE, GC_ATTR_NOINLINE, GC_API_OSCALL, GC_ATTR_FORMAT_PRINTF, NONNULL_ARG_NOT_NULL): Likewise. * include/private/gc_priv.h [CANCEL_SAFE] (GC_cancel_disable_count): Likewise. * include/private/gcconfig.h (HAVE_BUILTIN_UNWIND_INIT, PREFETCH, GC_PREFETCH_FOR_WRITE): Likewise. * include/private/gcconfig.h [I386 && LINUX && __ELF__] (GC_NO_SIGSETJMP): Likewise. * include/private/gcconfig.h [X86_64 && MSWIN32] (MPROTECT_VDB): Likewise. * include/private/thread_local_alloc.h [CYGWIN32] (USE_PTHREAD_SPECIFIC): Likewise. * include/private/thread_local_alloc.h [LINUX && !ARM32 && !AVR32 || PLATFORM_ANDROID && !__clang__] (USE_COMPILER_TLS): Likewise. * mark.c [MSWIN32 || MSWINCE] (GC_mark_some): Likewise. * mark_rts.c (GC_approx_sp): Likewise. * tests/test_cpp.cc (ATTR_UNUSED): Likewise. * tools/setjmp_t.c (nested_sp): Likewise. * include/gc_config_macros.h (GC_GNUC_PREREQ): New macro (not for public use). * include/private/gc_priv.h (GC_CLANG_PREREQ): New private macro. * include/private/gcconfig.h (HAVE_BUILTIN_UNWIND_INIT): Refine comment. * include/private/thread_local_alloc.h [LINUX && !ARM32 && !AVR32 || PLATFORM_ANDROID && !__clang__] (USE_COMPILER_TLS): Use GC_CLANG_PREREQ() instead of direct use of __clang_major__ and __clang_minor__. * mark.c [MSWIN32 || MSWINCE] (GC_mark_some): Likewise.
Diffstat (limited to 'cord')
-rw-r--r--cord/cordxtra.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cord/cordxtra.c b/cord/cordxtra.c
index cac407d4..61df89b4 100644
--- a/cord/cordxtra.c
+++ b/cord/cordxtra.c
@@ -63,7 +63,7 @@ typedef void (* oom_fn)(void);
ABORT("Out of memory"); }
# define ABORT(msg) { fprintf(stderr, "%s\n", msg); abort(); }
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
+#if GC_GNUC_PREREQ(3, 4)
# define CORD_ATTR_UNUSED __attribute__((__unused__))
#else
# define CORD_ATTR_UNUSED /* empty */