Skip to content

Commit 5416f8a

Browse files
committed
Merge branch 'cb/array-size'
* cb/array-size: Fix definition of ARRAY_SIZE for non-gcc builds
2 parents a6a1ad9 + e2c6f7c commit 5416f8a

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

git-compat-util.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,13 @@
5858
#define BUILD_ASSERT_OR_ZERO(cond) \
5959
(sizeof(char [1 - 2*!(cond)]) - 1)
6060

61-
#if defined(__GNUC__) && (__GNUC__ >= 3)
62-
# if GIT_GNUC_PREREQ(3, 1)
61+
#if GIT_GNUC_PREREQ(3, 1)
6362
/* &arr[0] degrades to a pointer: a different type from an array */
6463
# define BARF_UNLESS_AN_ARRAY(arr) \
6564
BUILD_ASSERT_OR_ZERO(!__builtin_types_compatible_p(__typeof__(arr), \
6665
__typeof__(&(arr)[0])))
67-
# else
68-
# define BARF_UNLESS_AN_ARRAY(arr) 0
69-
# endif
66+
#else
67+
# define BARF_UNLESS_AN_ARRAY(arr) 0
7068
#endif
7169
/*
7270
* ARRAY_SIZE - get the number of elements in a visible array

0 commit comments

Comments
 (0)