[PATCH] util.h: fix gcc version checking
Siddharth Agarwal
sid0 at fb.com
Thu Sep 19 11:57:48 CDT 2013
# HG changeset patch
# User Siddharth Agarwal <sid0 at fb.com>
# Date 1379609100 25200
# Thu Sep 19 09:45:00 2013 -0700
# Node ID a14b158920b990f6e65632767b59ed7cccc80858
# Parent 1b592791351d126d8af39f70bbc63a707a11a75f
util.h: fix gcc version checking
gcc doesn't have a predefined GCC_VERSION macro.
diff --git a/mercurial/util.h b/mercurial/util.h
--- a/mercurial/util.h
+++ b/mercurial/util.h
@@ -156,7 +156,7 @@
{
return _byteswap_ulong(*(uint32_t *)c);
}
-#elif GCC_VERSION >= 403
+#elif __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
static inline uint32_t getbe32(const char *c)
{
return __builtin_bswap32(*(uint32_t *)c);
@@ -179,7 +179,7 @@
x = _byteswap_ulong(x);
*(uint32_t *)c = x;
}
-#elif GCC_VERSION >= 403
+#elif __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
static inline void putbe32(uint32_t x, char *c)
{
x = __builtin_bswap32(x);
More information about the Mercurial-devel
mailing list