msvcrt/tests: We cannot link with _initterm() with Visual C++, so
we have to load it dynamically.
Francois Gouget
fgouget at free.fr
Thu Nov 23 14:38:51 CST 2006
---
This may mean that msvcrt.spec needs to be fixed too but I'm not sure so
I left it as is.
dlls/msvcrt/tests/data.c | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/dlls/msvcrt/tests/data.c b/dlls/msvcrt/tests/data.c
index b13d722..74980a2 100644
--- a/dlls/msvcrt/tests/data.c
+++ b/dlls/msvcrt/tests/data.c
@@ -32,7 +32,7 @@
#include <errno.h>
typedef void (*_INITTERMFUN)(void);
-extern unsigned int CDECL _initterm(_INITTERMFUN *start,_INITTERMFUN *end);
+static unsigned int (*p_initterm)(_INITTERMFUN *start, _INITTERMFUN *end);
static int callbacked;
@@ -43,7 +43,7 @@ void initcallback(void)
#define initterm_test(start, end, expected) \
callbacked = 0; \
- rc = _initterm(start, end); \
+ rc = p_initterm(start, end); \
ok(expected == rc, "_initterm: return result mismatch: got %i, expected %i\n", rc, expected); \
ok(expected == callbacked,"_initterm: callbacks count mismatch: got %i, expected %i\n", callbacked, expected);
@@ -53,6 +53,9 @@ void test_initterm(void)
int rc;
static _INITTERMFUN callbacks[4];
+ if (!p_initterm)
+ return;
+
for (i = 0; i < 4; i++)
{
callbacks[i] = initcallback;
@@ -68,5 +71,11 @@ void test_initterm(void)
START_TEST(data)
{
+ HMODULE hmsvcrt;
+ hmsvcrt = GetModuleHandleA("msvcrt.dll");
+ if (!hmsvcrt)
+ hmsvcrt = GetModuleHandleA("msvcrtd.dll");
+ if (hmsvcrt)
+ p_initterm=(void*)GetProcAddress(hmsvcrt, "_initterm");
test_initterm();
}
--
1.4.3.3
More information about the wine-patches
mailing list