* cb/array-size:
  Fix definition of ARRAY_SIZE for non-gcc builds
This commit is contained in:
Junio C Hamano 2015-06-25 11:07:42 -07:00
Родитель a6a1ad9b25 e2c6f7cd5a
Коммит 5416f8af0f
1 изменённых файлов: 3 добавлений и 5 удалений

Просмотреть файл

@ -58,7 +58,6 @@
#define BUILD_ASSERT_OR_ZERO(cond) \ #define BUILD_ASSERT_OR_ZERO(cond) \
(sizeof(char [1 - 2*!(cond)]) - 1) (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 */ /* &arr[0] degrades to a pointer: a different type from an array */
# define BARF_UNLESS_AN_ARRAY(arr) \ # define BARF_UNLESS_AN_ARRAY(arr) \
@ -67,7 +66,6 @@
#else #else
# define BARF_UNLESS_AN_ARRAY(arr) 0 # define BARF_UNLESS_AN_ARRAY(arr) 0
#endif #endif
#endif
/* /*
* ARRAY_SIZE - get the number of elements in a visible array * ARRAY_SIZE - get the number of elements in a visible array
* <at> x: the array whose size you want. * <at> x: the array whose size you want.