From 513025b18281647b33ca4d7d9cc18302f42d7507 Mon Sep 17 00:00:00 2001
From: Anonymous Maarten <[EMAIL REDACTED]>
Date: Thu, 23 Mar 2023 06:45:19 +0100
Subject: [PATCH] Implement _intel_fast_(memcpy|memset)
The classic Intel compiler generates calls to these functions when
building the SDL library with SDL_LIBC=OFF.
---
src/stdlib/SDL_mslibc.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/src/stdlib/SDL_mslibc.c b/src/stdlib/SDL_mslibc.c
index 0a6a6ac8449a..7097ecf0b263 100644
--- a/src/stdlib/SDL_mslibc.c
+++ b/src/stdlib/SDL_mslibc.c
@@ -700,4 +700,17 @@ void __declspec(naked) _aullshr()
#endif /* MSC_VER */
+#if defined(__ICL)
+/* The classic Intel compiler generates calls to _intel_fast_memcpy
+ * and _intel_fast_memset when building an optimized SDL library */
+void *_intel_fast_memcpy(void *dst, const void *src, size_t len)
+{
+ return SDL_memcpy(dst, src, len);
+}
+void *_intel_fast_memset(void *dst, int c, size_t len)
+{
+ return SDL_memset(dst, c, len);
+}
+#endif
+
#endif /* !HAVE_LIBC && !SDL_STATIC_LIB */