summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2014-03-22 22:23:26 +0100
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2014-03-22 22:25:21 +0100
commit202717d18fa318cef883ba358b77814f78167117 (patch)
tree597043becc4b45c3a92cdf2c2bab49cb8dd16b02
parentd85a84fc8391a4cc8bc923a7238f3c055ae3886d (diff)
downloadrockbox-202717d.tar.gz
rockbox-202717d.tar.bz2
rockbox-202717d.zip
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
-rw-r--r--rbutil/rbutilqt/mspack/system-mspack.h7
1 files changed, 6 insertions, 1 deletions
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;