[RUNTMCHK] Provide fallback memset for arm builds
authorMark Jansen <mark.jansen@reactos.org>
Sun, 18 Aug 2019 17:12:30 +0000 (19:12 +0200)
committerMark Jansen <mark.jansen@reactos.org>
Tue, 20 Aug 2019 20:28:11 +0000 (22:28 +0200)
sdk/lib/runtmchk/rtcapi.c

index 96631ca..82d4cd4 100644 (file)
 #error Unsupported platform
 #endif
 
+// Provide a fallback memset for libraries like kbdrost.dll
+#if defined(_M_ARM)
+void* __cdecl memset_fallback(void* src, int val, size_t count)
+{
+    char *char_src = (char *)src;
+    while(count > 0)
+    {
+        *char_src = val;
+        char_src++;
+        count--;
+    }
+    return src;
+}
+#pragma comment(linker, "/alternatename:memset=memset_fallback")
+#endif
+
 int
 __cdecl
 _RTC_DefaultErrorFuncW(