diff --git a/src/stdlib/SDL_memcpy.c b/src/stdlib/SDL_memcpy.c index 36a2bceaaa..6c6457652d 100644 --- a/src/stdlib/SDL_memcpy.c +++ b/src/stdlib/SDL_memcpy.c @@ -69,8 +69,10 @@ void *SDL_memcpy(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void switch (left) { case 3: *dstp1++ = *srcp1++; + SDL_FALLTHROUGH; case 2: *dstp1++ = *srcp1++; + SDL_FALLTHROUGH; case 1: *dstp1++ = *srcp1++; } @@ -84,11 +86,11 @@ void *SDL_memcpy(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void #ifndef HAVE_LIBC /* NOLINTNEXTLINE(readability-redundant-declaration) */ extern void *memcpy(void *dst, const void *src, size_t len); -#ifndef __INTEL_LLVM_COMPILER +#if defined(_MSC_VER) && !defined(__INTEL_LLVM_COMPILER) #pragma intrinsic(memcpy) #endif -#ifndef __clang__ +#if defined(_MSC_VER) && !defined(__clang__) #pragma function(memcpy) #endif /* NOLINTNEXTLINE(readability-inconsistent-declaration-parameter-name) */ diff --git a/src/stdlib/SDL_memmove.c b/src/stdlib/SDL_memmove.c index 38a75e0f2a..db5d319466 100644 --- a/src/stdlib/SDL_memmove.c +++ b/src/stdlib/SDL_memmove.c @@ -57,11 +57,11 @@ void *SDL_memmove(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void #ifndef HAVE_LIBC /* NOLINTNEXTLINE(readability-redundant-declaration) */ extern void *memmove(void *dst, const void *src, size_t len); -#ifndef __INTEL_LLVM_COMPILER +#if defined(_MSC_VER) && !defined(__INTEL_LLVM_COMPILER) #pragma intrinsic(memmove) #endif -#ifndef __clang__ +#if defined(_MSC_VER) && !defined(__clang__) #pragma function(memmove) #endif /* NOLINTNEXTLINE(readability-inconsistent-declaration-parameter-name) */ diff --git a/src/stdlib/SDL_memset.c b/src/stdlib/SDL_memset.c index 90ecbeedd3..2103ff183f 100644 --- a/src/stdlib/SDL_memset.c +++ b/src/stdlib/SDL_memset.c @@ -67,8 +67,10 @@ void *SDL_memset(SDL_OUT_BYTECAP(len) void *dst, int c, size_t len) switch (left) { case 3: *dstp1++ = value1; + SDL_FALLTHROUGH; case 2: *dstp1++ = value1; + SDL_FALLTHROUGH; case 1: *dstp1++ = value1; } @@ -121,11 +123,11 @@ void *SDL_memset4(void *dst, Uint32 val, size_t dwords) #ifndef HAVE_LIBC /* NOLINTNEXTLINE(readability-redundant-declaration) */ extern void *memset(void *dst, int c, size_t len); -#ifndef __INTEL_LLVM_COMPILER +#if defined(_MSC_VER) && !defined(__INTEL_LLVM_COMPILER) #pragma intrinsic(memset) #endif -#ifndef __clang__ +#if defined(_MSC_VER) && !defined(__clang__) #pragma function(memset) #endif /* NOLINTNEXTLINE(readability-inconsistent-declaration-parameter-name) */