summaryrefslogtreecommitdiff
path: root/src/xdiff/xdiffi.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2018-06-25 11:55:13 +0200
committerPatrick Steinhardt <ps@pks.im>2018-07-13 08:25:12 +0200
commitf347a441c81c4e16dd54de07c5070eca8fccd5c8 (patch)
tree7a641184da70f62c175b0b24139af6dc60de14e5 /src/xdiff/xdiffi.c
parent6dfc8bc2499db78eae4e29dd121c75121f0e8baf (diff)
downloadlibgit2-f347a441c81c4e16dd54de07c5070eca8fccd5c8.tar.gz
treewide: avoid use of `inline` attribute
ISO C90 does not specify the `inline` attribute, and as such we cannot use it in our code. While we already use `__inline` when building in Microsoft Visual Studio, we should also be using the `__inline__` attribute from GCC/Clang. Otherwise, if we're using neither MSVC nor GCC/Clang, we should simply avoid using `inline` at all and just define functions as static. This commit adjusts our own `GIT_INLINE` macro as well as the inline macros specified by khash and xdiff. This allows us to enable strict C90 mode in a later commit.
Diffstat (limited to 'src/xdiff/xdiffi.c')
-rw-r--r--src/xdiff/xdiffi.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/xdiff/xdiffi.c b/src/xdiff/xdiffi.c
index 3a71ef678..97db05466 100644
--- a/src/xdiff/xdiffi.c
+++ b/src/xdiff/xdiffi.c
@@ -33,8 +33,10 @@
/** Declare a function as always inlined. */
#if defined(_MSC_VER)
# define XDL_INLINE(type) static __inline type
+#elif defined(__GNUC__)
+# define XDL_INLINE(type) static __inline__ type
#else
-# define XDL_INLINE(type) static inline type
+#define XDG_INLINE(type) static type
#endif
typedef struct s_xdpsplit {