]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - gmqcc.h
This should be the tag
[xonotic/gmqcc.git] / gmqcc.h
diff --git a/gmqcc.h b/gmqcc.h
index 576057ac8c71e61f48d59a5d303768cbb2edc88f..ff74f45163d098c4e33c1f4684b32201ac7dae5c 100644 (file)
--- a/gmqcc.h
+++ b/gmqcc.h
@@ -41,7 +41,7 @@
 #define GMQCC_VERSION \
     GMQCC_VERSION_BUILD(GMQCC_VERSION_MAJOR, GMQCC_VERSION_MINOR, GMQCC_VERSION_PATCH)
 /* Undefine the following on a release-tag: */
-#define GMQCC_VERSION_TYPE_DEVEL
+/*#define GMQCC_VERSION_TYPE_DEVEL*/
 
 /* Full version string in case we need it */
 #ifdef GMQCC_VERSION_TYPE_DEVEL
@@ -149,6 +149,16 @@ GMQCC_IND_STRING(GMQCC_VERSION_PATCH) \
 #    define GMQCC_NORETURN
 #endif /*! (defined(__GNUC__) && __GNUC__ >= 2) || defined (__CLANG__) */
 
+#if (defined(__GNUC__)) || defined(__CLANG__)
+#   define GMQCC_LIKELY(X)   __builtin_expect((X), 1)
+#   define GMQCC_UNLIKELY(X) __builtin_expect((X), 0)
+#else
+#   define GMQCC_LIKELY(X)   (X)
+#   define GMQCC_UNLIKELY(X) (X)
+#endif
+
+#define GMQCC_ARRAY_COUNT(X) (sizeof(X) / sizeof((X)[0]))
+
 #ifndef _MSC_VER
 #   include <stdint.h>
 #else