summaryrefslogtreecommitdiff
path: root/git-compat-util.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-06-26 06:03:25 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-06-26 06:03:25 (GMT)
commitb1f0802e9127b117bae7a4cfdc81495f7a9a09f3 (patch)
tree8b122e2d81b80c25f7302e5fd871b1a50995d3e7 /git-compat-util.h
parent0df0541bf13723658d31b8d1376b505b710e63c6 (diff)
parente2c6f7cd5a66ed0009662d2651e0cf3c655e83a9 (diff)
downloadgit-b1f0802e9127b117bae7a4cfdc81495f7a9a09f3.zip
git-b1f0802e9127b117bae7a4cfdc81495f7a9a09f3.tar.gz
git-b1f0802e9127b117bae7a4cfdc81495f7a9a09f3.tar.bz2
Merge branch 'cb/array-size' into maint
* cb/array-size: Fix definition of ARRAY_SIZE for non-gcc builds
Diffstat (limited to 'git-compat-util.h')
-rw-r--r--git-compat-util.h8
1 files changed, 3 insertions, 5 deletions
diff --git a/git-compat-util.h b/git-compat-util.h
index 3be44f1..af5af22 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -58,15 +58,13 @@
#define BUILD_ASSERT_OR_ZERO(cond) \
(sizeof(char [1 - 2*!(cond)]) - 1)
-#if defined(__GNUC__) && (__GNUC__ >= 3)
-# if GIT_GNUC_PREREQ(3, 1)
+#if GIT_GNUC_PREREQ(3, 1)
/* &arr[0] degrades to a pointer: a different type from an array */
# define BARF_UNLESS_AN_ARRAY(arr) \
BUILD_ASSERT_OR_ZERO(!__builtin_types_compatible_p(__typeof__(arr), \
__typeof__(&(arr)[0])))
-# else
-# define BARF_UNLESS_AN_ARRAY(arr) 0
-# endif
+#else
+# define BARF_UNLESS_AN_ARRAY(arr) 0
#endif
/*
* ARRAY_SIZE - get the number of elements in a visible array