]>
git.proxmox.com Git - libgit2.git/blob - src/cc-compat.h
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 * Does our compiler/platform support the C99 <inttypes.h> and
35 * <stdint.h> header files. (C99 requires that <inttypes.h>
36 * includes <stdint.h>).
38 #if !defined(_MSC_VER)
39 # define GIT_HAVE_INTTYPES_H 1
42 /* Define the printf format specifer to use for size_t output */
43 #if !defined(_MSC_VER)
49 /* Micosoft Visual C/C++ */
51 /* no direct support for C99 inline function specifier */
52 # define inline __inline
53 /* disable "deprecated function" warnings */
54 # pragma warning ( disable : 4996 )
57 #endif /* INCLUDE_compat_h__ */