mirror of
https://github.com/git/git.git
synced 2026-01-08 09:13:48 +00:00
Merge branch 'jc/c99-fam'
Require C99 style flexible array member support from all platforms. * jc/c99-fam: FLEX_ARRAY: require platforms to support the C99 syntax
This commit is contained in:
@@ -38,37 +38,8 @@ struct strbuf;
|
|||||||
DISABLE_WARNING(-Wsign-compare)
|
DISABLE_WARNING(-Wsign-compare)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef FLEX_ARRAY
|
#undef FLEX_ARRAY
|
||||||
/*
|
#define FLEX_ARRAY /* empty - weather balloon to require C99 FAM */
|
||||||
* See if our compiler is known to support flexible array members.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Check vendor specific quirks first, before checking the
|
|
||||||
* __STDC_VERSION__, as vendor compilers can lie and we need to be
|
|
||||||
* able to work them around. Note that by not defining FLEX_ARRAY
|
|
||||||
* here, we can fall back to use the "safer but a bit wasteful" one
|
|
||||||
* later.
|
|
||||||
*/
|
|
||||||
#if defined(__SUNPRO_C) && (__SUNPRO_C <= 0x580)
|
|
||||||
#elif defined(__GNUC__)
|
|
||||||
# if (__GNUC__ >= 3)
|
|
||||||
# define FLEX_ARRAY /* empty */
|
|
||||||
# else
|
|
||||||
# define FLEX_ARRAY 0 /* older GNU extension */
|
|
||||||
# endif
|
|
||||||
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
|
|
||||||
# define FLEX_ARRAY /* empty */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Otherwise, default to safer but a bit wasteful traditional style
|
|
||||||
*/
|
|
||||||
#ifndef FLEX_ARRAY
|
|
||||||
# define FLEX_ARRAY 1
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* BUILD_ASSERT_OR_ZERO - assert a build-time dependency, as an expression.
|
* BUILD_ASSERT_OR_ZERO - assert a build-time dependency, as an expression.
|
||||||
|
|||||||
Reference in New Issue
Block a user