summaryrefslogtreecommitdiff
path: root/mach_dep.c
diff options
context:
space:
mode:
authorMichael DeRoy <michaelde@unity3d.com>2018-10-29 07:45:59 +0300
committerIvan Maidanski <ivmai@mail.ru>2018-10-29 07:45:59 +0300
commit548ac4fbc61ed69057cbc45f71a7261e8f581b58 (patch)
treedcd58c71bba6c33e716e9d03287f5774cbffc189 /mach_dep.c
parent1471f940e9917fcb5d8a2afc34a2854da3a2bad2 (diff)
downloadbdwgc-548ac4fbc61ed69057cbc45f71a7261e8f581b58.tar.gz
Enable compilation without C runtime (Win32)
(part of commit 193af77 from Unity-Technologies/bdwgc) * include/private/gcconfig.h [MSWIN32 && !__GNUC__ && !NO_WRAP_MARK_SOME] (WRAP_MARK_SOME): Do not define if NO_CRT. * mach_dep.c [!HAVE_BUILTIN_UNWIND_INIT && NO_CRT && MSWIN32] (GC_with_callee_saves_pushed): Call RtlCaptureContext() instead of setjmp(). * misc.c [MSWIN32 && _MSC_VER && _DEBUG] (GC_write): Do not call MultiByteToWideChar() and OutputDebugStringW() if NO_CRT. * win32_threads.c [NO_CRT] (GC_NO_THREADS_DISCOVERY): Define. * win32_threads.c [!__GNUC__] (GC_win32_start_inner): Do not use __try and __finally if NO_CRT. * win32_threads.c [!CYGWIN32 && !MSWINCE && !MSWIN_XBOX1] (GC_beginthreadex): Do not define if NO_CRT.
Diffstat (limited to 'mach_dep.c')
-rw-r--r--mach_dep.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/mach_dep.c b/mach_dep.c
index 60b73b22..8df57474 100644
--- a/mach_dep.c
+++ b/mach_dep.c
@@ -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. */