2 * cc-compat.h - C compiler compat macros for internal use
4 #ifndef INCLUDE_compat_h__
5 #define INCLUDE_compat_h__
8 * See if our compiler is known to support flexible array members.
10 #ifndef GIT_FLEX_ARRAY
11 # if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
12 # define GIT_FLEX_ARRAY /* empty */
13 # elif defined(__GNUC__)
15 # define GIT_FLEX_ARRAY /* empty */
17 # define GIT_FLEX_ARRAY 0 /* older GNU extension */
21 /* Default to safer but a bit wasteful traditional style */
22 # ifndef GIT_FLEX_ARRAY
23 # define GIT_FLEX_ARRAY 1
28 # define GIT_TYPEOF(x) (__typeof__(x))
30 # define GIT_TYPEOF(x)
34 # define GIT_UNUSED(x)
37 # define GIT_UNUSED(x) x __attribute__ ((__unused__))
39 # define GIT_UNUSED(x) x
44 #define GIT_UNUSED_ARG(x) ((void)(x)); /* note trailing ; */
46 #define GIT_UNUSED_ARG(x)
50 * Does our compiler/platform support the C99 <inttypes.h> and
51 * <stdint.h> header files. (C99 requires that <inttypes.h>
52 * includes <stdint.h>).
54 #if !defined(_MSC_VER)
55 # define GIT_HAVE_INTTYPES_H 1
58 /* Define the printf format specifer to use for size_t output */
59 #if defined(_MSC_VER) || defined(__MINGW32__)
65 /* Micosoft Visual C/C++ */
67 /* disable "deprecated function" warnings */
68 # pragma warning ( disable : 4996 )
69 /* disable "conditional expression is constant" level 4 warnings */
70 # pragma warning ( disable : 4127 )
73 #endif /* INCLUDE_compat_h__ */