Merge pull request #6200 from boretrk/c90 C90: add inline macro to xdiff and mbedtls
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
diff --git a/src/streams/mbedtls.c b/src/streams/mbedtls.c
index b3a35ab..0cf5c8a 100644
--- a/src/streams/mbedtls.c
+++ b/src/streams/mbedtls.c
@@ -23,12 +23,14 @@
#endif
/* Work around C90-conformance issues */
-#if defined(_MSC_VER)
-# define inline __inline
-#elif defined(__GNUC__)
-# define inline __inline__
-#else
-# define inline
+#if !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L)
+# if defined(_MSC_VER)
+# define inline __inline
+# elif defined(__GNUC__)
+# define inline __inline__
+# else
+# define inline
+# endif
#endif
#include <mbedtls/config.h>
diff --git a/src/xdiff/git-xdiff.h b/src/xdiff/git-xdiff.h
index 0b4f0bc..b75dba8 100644
--- a/src/xdiff/git-xdiff.h
+++ b/src/xdiff/git-xdiff.h
@@ -16,6 +16,17 @@
#include "regexp.h"
+/* Work around C90-conformance issues */
+#if !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L)
+# if defined(_MSC_VER)
+# define inline __inline
+# elif defined(__GNUC__)
+# define inline __inline__
+# else
+# define inline
+# endif
+#endif
+
#define xdl_malloc(x) git__malloc(x)
#define xdl_free(ptr) git__free(ptr)
#define xdl_realloc(ptr, x) git__realloc(ptr, x)