#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. */
/* 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. */
# 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 */
{
/* 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)
/* 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
{
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 *),
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. */