diff options
-rw-r--r-- | include/private/gcconfig.h | 2 | ||||
-rw-r--r-- | mach_dep.c | 3 | ||||
-rw-r--r-- | misc.c | 2 | ||||
-rw-r--r-- | win32_threads.c | 11 |
4 files changed, 11 insertions, 7 deletions
diff --git a/include/private/gcconfig.h b/include/private/gcconfig.h index 17163fe5..48907ca0 100644 --- a/include/private/gcconfig.h +++ b/include/private/gcconfig.h @@ -3268,7 +3268,7 @@ EXTERN_C_BEGIN #if (((defined(MSWIN32) || defined(MSWINCE)) && !defined(__GNUC__)) \ || (defined(MSWIN32) && defined(I386)) /* for Win98 */ \ || (defined(USE_PROC_FOR_LIBRARIES) && defined(THREADS))) \ - && !defined(NO_WRAP_MARK_SOME) + && !defined(NO_CRT) && !defined(NO_WRAP_MARK_SOME) /* Under rare conditions, we may end up marking from nonexistent */ /* memory. Hence we need to be prepared to recover by running */ /* GC_mark_some with a suitable handler in place. */ @@ -298,6 +298,9 @@ GC_INNER void GC_with_callee_saves_pushed(void (*fn)(ptr_t, void *), /* force callee-save registers and register windows onto */ /* the stack. */ __builtin_unwind_init(); +# elif defined(NO_CRT) && defined(MSWIN32) + CONTEXT ctx; + RtlCaptureContext(&ctx); # else /* Generic code */ /* The idea is due to Parag Patel at HP. */ @@ -1659,7 +1659,7 @@ GC_API void GC_CALL GC_enable_incremental(void) # endif } res = WriteFile(GC_log, buf, (DWORD)len, &written, NULL); -# if defined(_MSC_VER) && defined(_DEBUG) +# if defined(_MSC_VER) && defined(_DEBUG) && !defined(NO_CRT) # ifdef MSWINCE /* There is no CrtDbgReport() in WinCE */ { diff --git a/win32_threads.c b/win32_threads.c index db03d09f..cec6729e 100644 --- a/win32_threads.c +++ b/win32_threads.c @@ -76,7 +76,7 @@ /* DllMain-based thread registration is currently incompatible */ /* with thread-local allocation, pthreads and WinCE. */ -#if (defined(GC_DLL) || defined(GC_INSIDE_DLL)) \ +#if (defined(GC_DLL) || defined(GC_INSIDE_DLL)) && !defined(NO_CRT) \ && !defined(GC_NO_THREADS_DISCOVERY) && !defined(MSWINCE) \ && !defined(THREAD_LOCAL_ALLOC) && !defined(GC_PTHREADS) @@ -2208,14 +2208,14 @@ GC_INNER void GC_get_next_stack(char *start, char *limit, /* Clear the thread entry even if we exit with an exception. */ /* This is probably pointless, since an uncaught exception is */ /* supposed to result in the process being killed. */ -# ifndef __GNUC__ +# if !defined(__GNUC__) && !defined(NO_CRT) ret = NULL; /* to suppress "might be uninitialized" compiler warning */ __try # endif { ret = (void *)(word)(*start)(param); } -# ifndef __GNUC__ +# if !defined(__GNUC__) && !defined(NO_CRT) __finally # endif { @@ -2284,7 +2284,8 @@ GC_INNER void GC_get_next_stack(char *start, char *limit, ExitThread(dwExitCode); } -# if !defined(CYGWIN32) && !defined(MSWINCE) && !defined(MSWIN_XBOX1) +# if !defined(CYGWIN32) && !defined(MSWINCE) && !defined(MSWIN_XBOX1) \ + && !defined(NO_CRT) GC_API GC_uintptr_t GC_CALL GC_beginthreadex( void *security, unsigned stack_size, unsigned (__stdcall *start_address)(void *), @@ -2338,7 +2339,7 @@ GC_INNER void GC_get_next_stack(char *start, char *limit, GC_unregister_my_thread(); _endthreadex(retval); } -# endif /* !CYGWIN32 && !MSWINCE && !MSWIN_XBOX1 */ +# endif /* !CYGWIN32 && !MSWINCE && !MSWIN_XBOX1 && !NO_CRT */ #ifdef GC_WINMAIN_REDIRECT /* This might be useful on WinCE. Shouldn't be used with GC_DLL. */ |