path: root/include
diff options
authorRob Kendrick (humdrum) <>2013-04-25 15:13:36 +0100
committerRob Kendrick (humdrum) <>2013-04-25 15:13:36 +0100
commitfb5c3f3169d3a8d1e85626914b55825733b5376c (patch)
treefcbd30f7b9c369b0c1dbf1930d87eb8e6029843e /include
parent9aeab2e5176285583f8d669ba79ce6ff45b81a00 (diff)
Rationalise UNUSED macros. This changeset allows libnsfb to berjek/clang-warnings
built warning-free both with Clang 3.3 (from trunk) and GCC 4.7. Remove the use of GCC-specific __attribute__ ((unused)) as this only works on declarations, meaning there is no "fallback" to use on compilers that are not GCC or clang. The (void)foo; approach works with both clang and GCC, and hopefully other compilers people might be using. The alternative would to have been two UNUSED macros, one for use in definitions, and one for use in function bodies.
Diffstat (limited to 'include')
1 files changed, 3 insertions, 0 deletions
diff --git a/include/nsfb.h b/include/nsfb.h
index 9a61775..1332695 100644
--- a/include/nsfb.h
+++ b/include/nsfb.h
@@ -13,6 +13,9 @@
#include <stdint.h>
+#ifndef UNUSED
+# define UNUSED(x) (void) (x)
/** NS Framebuffer context