From d505fd74d137ec1d971537f11011c04f7b6dc3d1 Mon Sep 17 00:00:00 2001 From: David Schleef Date: Sat, 9 Jul 2011 19:35:27 -0700 Subject: [PATCH] Move ORC_GNUC_UNUSED to orcutils.h and use it --- orc-test/orctest.c | 6 ------ orc/orcparse.c | 3 ++- orc/orcutils.h | 6 ++++++ 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/orc-test/orctest.c b/orc-test/orctest.c index 71c701f..a847765 100644 --- a/orc-test/orctest.c +++ b/orc-test/orctest.c @@ -21,12 +21,6 @@ #define MIN_NONDENORMAL (1.1754944909521339405e-38) -#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4) -#define ORC_GNUC_UNUSED __attribute__((__unused__)) -#else -#define ORC_GNUC_UNUSED -#endif - void _orc_profile_init(void); OrcRandomContext rand_context; diff --git a/orc/orcparse.c b/orc/orcparse.c index ae61867..83fb987 100644 --- a/orc/orcparse.c +++ b/orc/orcparse.c @@ -285,8 +285,9 @@ orc_parse_full (const char *code, OrcProgram ***programs, char **log) for(i=offset+1;iprogram, 0, token[i], token[i]); diff --git a/orc/orcutils.h b/orc/orcutils.h index f627f1b..9df479d 100644 --- a/orc/orcutils.h +++ b/orc/orcutils.h @@ -148,6 +148,12 @@ typedef unsigned int orc_bool; #define ORC_GNU_PRINTF(a,b) #endif +#if ORC_GNUC_PREREQ(2,4) +#define ORC_GNUC_UNUSED __attribute__((__unused__)) +#else +#define ORC_GNUC_UNUSED +#endif + #ifdef __cplusplus #define ORC_BEGIN_DECLS extern "C" { #define ORC_END_DECLS } -- 2.7.4