summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkira TAGOH <akira@tagoh.org>2011-02-18 22:47:26 +0900
committerAkira TAGOH <akira@tagoh.org>2011-02-18 22:47:26 +0900
commit00ccaeac010d565e908b16c3fea238da4b5013d0 (patch)
treec4950843863624646b49b3dc6e10eeb9d2b98194
parent6ef55642f56371772d20d5b45a8d359cd29f6f87 (diff)
add macros for gcc extensions
-rw-r--r--hieroglyph/hgmacros.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/hieroglyph/hgmacros.h b/hieroglyph/hgmacros.h
index 53da900..7710db1 100644
--- a/hieroglyph/hgmacros.h
+++ b/hieroglyph/hgmacros.h
@@ -39,6 +39,17 @@
# define hg_d(x)
#endif /* GNOME_ENABLE_DEBUG || DEBUG */
+/* Provide macros to feature the GCC function attribute. */
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
+#define HG_GNUC_CONST \
+ __attribute__((__const__))
+#define HG_GNUC_UNUSED \
+ __attribute__((__unused__))
+#else
+#define HG_GNUC_CONST
+#define HG_GNUC_UNUSED
+#endif
+
/* Guard C code in headers, while including them from C++ */
#ifdef __cplusplus
# define HG_BEGIN_DECLS extern "C" {