[CRT] Add abs and labs to CRT lib
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Sat, 26 Dec 2015 17:13:08 +0000 (17:13 +0000)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Sat, 26 Dec 2015 17:13:08 +0000 (17:13 +0000)
[MSVCRT] Explicitly pull in _vsnprintf, bsearch and strcspn from CRT, to prevent the MS linker from exporting stubs from libntdll instead.
See CORE-10753

svn path=/trunk/; revision=70425

reactos/dll/win32/msvcrt/dllmain.c
reactos/lib/sdk/crt/crt.cmake

index 1576a92..c34f071 100644 (file)
@@ -125,4 +125,18 @@ DllMain(PVOID hinstDll, ULONG dwReason, PVOID reserved)
     return TRUE;
 }
 
     return TRUE;
 }
 
+/* FIXME: This hack is required to prevent the VC linker from linking these
+   exports to the functions from libntdll. See CORE-10753 */
+#ifdef _MSC_VER
+#ifdef _M_IX86
+#pragma comment(linker, "/include:__vsnprintf")
+#pragma comment(linker, "/include:_bsearch")
+#pragma comment(linker, "/include:_strcspn")
+#else
+#pragma comment(linker, "/include:_vsnprintf")
+#pragma comment(linker, "/include:bsearch")
+#pragma comment(linker, "/include:strcspn")
+#endif // _M_IX86
+#endif // _MSC_VER
+
 /* EOF */
 /* EOF */
index bee453d..ba65bd4 100644 (file)
@@ -34,6 +34,7 @@ list(APPEND CRT_SOURCE
     float/nafter.c
     float/scalb.c
     locale/locale.c
     float/nafter.c
     float/scalb.c
     locale/locale.c
+    math/abs.c
     math/acos.c
     math/adjust.c
     math/asin.c
     math/acos.c
     math/adjust.c
     math/asin.c
@@ -51,6 +52,7 @@ list(APPEND CRT_SOURCE
     math/j0_y0.c
     math/j1_y1.c
     math/jn_yn.c
     math/j0_y0.c
     math/j1_y1.c
     math/jn_yn.c
+    math/labs.c
     math/ldiv.c
     math/logf.c
     math/modf.c
     math/ldiv.c
     math/logf.c
     math/modf.c