From 202717d18fa318cef883ba358b77814f78167117 Mon Sep 17 00:00:00 2001 From: Dominik Riebeling Date: Sat, 22 Mar 2014 22:23:26 +0100 Subject: [PATCH] Fix MSVC not knowing inline for C code. MSVC needs to use __inline instead of inline when compiling C code (the inline keyword is only avaliable in C++). Use the preprocessor to work around this. Change-Id: Ic9884a7421cee7dc7c943ab205312f50233fb100 --- rbutil/rbutilqt/mspack/system-mspack.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rbutil/rbutilqt/mspack/system-mspack.h b/rbutil/rbutilqt/mspack/system-mspack.h index dd3c325ffa..7a033cb04a 100644 --- a/rbutil/rbutilqt/mspack/system-mspack.h +++ b/rbutil/rbutilqt/mspack/system-mspack.h @@ -108,7 +108,12 @@ extern int mspack_valid_system(struct mspack_system *sys); # define mspack_memcmp memcmp #else /* inline memcmp() */ -static inline int mspack_memcmp(const void *s1, const void *s2, size_t n) { +#ifdef _MSC_VER /* MSVC requires use of __inline instead of inline */ +#define INLINE __inline +#else +#define INLINE inline +#endif +static INLINE int mspack_memcmp(const void *s1, const void *s2, size_t n) { unsigned char *c1 = (unsigned char *) s1; unsigned char *c2 = (unsigned char *) s2; if (n == 0) return 0;