Correct the spelling of the FLEX_ARRAY macro When setting the default value, the macro name was specified as GIT_FLEX_ARRAY, which is inconsistent with it's earlier usage in the file. This caused a compilation error, using the MS Visual C/C++ compiler, when compiling the git_packlist struct definition in src/odb.c. In addition to changing the spelling of the FLEX_ARRAY macro to GIT_FLEX_ARRAY, including it's use in src/odb.c, we also rename the TYPEOF macro to GIT_TYPEOF. Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
diff --git a/src/cc-compat.h b/src/cc-compat.h
index 41fb16c..32e4139 100644
--- a/src/cc-compat.h
+++ b/src/cc-compat.h
@@ -7,14 +7,14 @@
/*
* See if our compiler is known to support flexible array members.
*/
-#ifndef FLEX_ARRAY
+#ifndef GIT_FLEX_ARRAY
# if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
-# define FLEX_ARRAY /* empty */
+# define GIT_FLEX_ARRAY /* empty */
# elif defined(__GNUC__)
# if (__GNUC__ >= 3)
-# define FLEX_ARRAY /* empty */
+# define GIT_FLEX_ARRAY /* empty */
# else
-# define FLEX_ARRAY 0 /* older GNU extension */
+# define GIT_FLEX_ARRAY 0 /* older GNU extension */
# endif
# endif
@@ -25,9 +25,9 @@
#endif
#ifdef __GNUC__
-# define TYPEOF(x) (__typeof__(x))
+# define GIT_TYPEOF(x) (__typeof__(x))
#else
-# define TYPEOF(x)
+# define GIT_TYPEOF(x)
#endif
#endif /* INCLUDE_compat_h__ */
diff --git a/src/odb.c b/src/odb.c
index 5f10ae0..ea28d01 100644
--- a/src/odb.c
+++ b/src/odb.c
@@ -70,7 +70,7 @@ typedef struct git_pack git_pack;
typedef struct {
size_t n_packs;
unsigned int refcnt;
- git_pack *packs[FLEX_ARRAY];
+ git_pack *packs[GIT_FLEX_ARRAY];
} git_packlist;
struct git_odb {