From f347a441c81c4e16dd54de07c5070eca8fccd5c8 Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Mon, 25 Jun 2018 11:55:13 +0200 Subject: 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. --- src/khash.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/khash.h') diff --git a/src/khash.h b/src/khash.h index 71eb583d5..40e2d1848 100644 --- a/src/khash.h +++ b/src/khash.h @@ -146,8 +146,10 @@ typedef unsigned long long khint64_t; #ifndef kh_inline #ifdef _MSC_VER #define kh_inline __inline +#elif defined(__GNUC__) +#define kh_inline __inline__ #else -#define kh_inline inline +#define kh_inline #endif #endif /* kh_inline */ -- cgit v1.2.1