Commit b3384af2d8c239c94a5067abb81a9bb433f95096

Peter Pettersson 2022-02-03T12:27:01

C90: add inline macro to xdiff and mbedtls

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)