forked from len0rd/rockbox
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
This commit is contained in:
parent
d85a84fc83
commit
202717d18f
1 changed files with 6 additions and 1 deletions
|
|
@ -108,7 +108,12 @@ extern int mspack_valid_system(struct mspack_system *sys);
|
||||||
# define mspack_memcmp memcmp
|
# define mspack_memcmp memcmp
|
||||||
#else
|
#else
|
||||||
/* inline memcmp() */
|
/* 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 *c1 = (unsigned char *) s1;
|
||||||
unsigned char *c2 = (unsigned char *) s2;
|
unsigned char *c2 = (unsigned char *) s2;
|
||||||
if (n == 0) return 0;
|
if (n == 0) return 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue