]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
GMQCC_WARN macro
authorWolfgang (Blub) Bumiller <blub@speed.at>
Fri, 27 Apr 2012 10:35:59 +0000 (12:35 +0200)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Fri, 27 Apr 2012 10:35:59 +0000 (12:35 +0200)
gmqcc.h

diff --git a/gmqcc.h b/gmqcc.h
index e16b4954859f80bce2b78de72bd5cc42350b077d..09311cc7bdf91d75f19388a0531bbb66a9b7e3e6 100644 (file)
--- a/gmqcc.h
+++ b/gmqcc.h
 #   endif
 #   endif /* !__cplusplus */
 
+/*
+ * Of some functions which are generated we want to make sure
+ * that the result isn't ignored. To find such function calls,
+ * we use this macro.
+ */
+#if defined(__GNUC__) || defined(__CLANG__)
+#   define GMQCC_WARN __attribute__((warn_unused_result))
+#else
+#   define GMQCC_WARN
+#endif
+
 /*
  * stdint.h and inttypes.h -less subset
  * for systems that don't have it, which we must