Move ORC_GNUC_UNUSED to orcutils.h and use it
authorDavid Schleef <ds@schleef.org>
Sun, 10 Jul 2011 02:35:27 +0000 (19:35 -0700)
committerDavid Schleef <ds@schleef.org>
Sun, 10 Jul 2011 02:35:27 +0000 (19:35 -0700)
orc-test/orctest.c
orc/orcparse.c
orc/orcutils.h

index 71c701f..a847765 100644 (file)
 
 #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;
index ae61867..83fb987 100644 (file)
@@ -285,8 +285,9 @@ orc_parse_full (const char *code, OrcProgram ***programs, char **log)
 
         for(i=offset+1;i<n_tokens;i++){
           char *end;
+          double unused ORC_GNUC_UNUSED;
 
-          (void) strtod (token[i], &end);
+          unused = strtod (token[i], &end);
           if (end != token[i]) {
             orc_program_add_constant_str (parser->program, 0, token[i],
                 token[i]);
index f627f1b..9df479d 100644 (file)
@@ -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 }