summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Schleef <ds@schleef.org>2011-07-09 19:35:27 -0700
committerDavid Schleef <ds@schleef.org>2011-07-09 19:35:27 -0700
commitd505fd74d137ec1d971537f11011c04f7b6dc3d1 (patch)
treee603bde20de20c7529e626c6bd7a5d0c9ed479c2
parentf11848eefbe6291cf593b0065b07499bad5ce5a4 (diff)
Move ORC_GNUC_UNUSED to orcutils.h and use it
-rw-r--r--orc-test/orctest.c6
-rw-r--r--orc/orcparse.c3
-rw-r--r--orc/orcutils.h6
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;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]);
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 }