diff options
-rw-r--r-- | tests/test.c | 15 | ||||
-rw-r--r-- | tests/test_cpp.cc | 10 |
2 files changed, 16 insertions, 9 deletions
diff --git a/tests/test.c b/tests/test.c index 446a6b88..7d91d2dd 100644 --- a/tests/test.c +++ b/tests/test.c @@ -1593,7 +1593,8 @@ void GC_CALLBACK warn_proc(char *msg, GC_word p) #if !defined(PCR) && !defined(GC_WIN32_THREADS) && !defined(GC_PTHREADS) \ || defined(LINT) -#if defined(MSWIN32) && !defined(__MINGW32__) || defined(MSWINCE) +#if ((defined(MSWIN32) && !defined(__MINGW32__)) || defined(MSWINCE)) \ + && !defined(NO_WINMAIN_ENTRY) int APIENTRY WinMain(HINSTANCE instance GC_ATTR_UNUSED, HINSTANCE prev GC_ATTR_UNUSED, WINMAIN_LPTSTR cmd GC_ATTR_UNUSED, @@ -1736,10 +1737,14 @@ DWORD __stdcall thr_window(void * arg GC_ATTR_UNUSED) } #endif -int APIENTRY WinMain(HINSTANCE instance GC_ATTR_UNUSED, - HINSTANCE prev GC_ATTR_UNUSED, - WINMAIN_LPTSTR cmd GC_ATTR_UNUSED, - int n GC_ATTR_UNUSED) +#if !defined(NO_WINMAIN_ENTRY) + int APIENTRY WinMain(HINSTANCE instance GC_ATTR_UNUSED, + HINSTANCE prev GC_ATTR_UNUSED, + WINMAIN_LPTSTR cmd GC_ATTR_UNUSED, + int n GC_ATTR_UNUSED) +#else + int main(void) +#endif { # if NTHREADS > 0 HANDLE h[NTHREADS]; diff --git a/tests/test_cpp.cc b/tests/test_cpp.cc index 1a413774..041151ca 100644 --- a/tests/test_cpp.cc +++ b/tests/test_cpp.cc @@ -191,10 +191,12 @@ GC_word Disguise( void* p ) { void* Undisguise( GC_word i ) { return (void*) ~ i;} -#ifdef MSWIN32 -int APIENTRY WinMain( HINSTANCE instance ATTR_UNUSED, - HINSTANCE prev ATTR_UNUSED, LPSTR cmd, int cmdShow ATTR_UNUSED ) -{ +#if ((defined(MSWIN32) && !defined(__MINGW32__)) || defined(MSWINCE)) \ + && !defined(NO_WINMAIN_ENTRY) + int APIENTRY WinMain( HINSTANCE instance ATTR_UNUSED, + HINSTANCE prev ATTR_UNUSED, LPSTR cmd, + int cmdShow ATTR_UNUSED ) + { int argc = 0; char* argv[ 3 ]; |