]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - gmqcc.h
GMQCC_WARN macro
[xonotic/gmqcc.git] / 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