[Gc] Fix for mingw-w64

Ivan Maidanski ivmai at mail.ru
Fri Nov 7 06:14:28 PST 2008


Hi!

This patch fixes gcconfig.h and mark.c files for MSWIN32+X86_64+GNUC (SEH is not needed in GC_mark_some() since GetWriteWatch() is available; SEH implementation on Win64 differs from that on Win32; gcc still lacks __try/__finally support).

Tip: -DGC_NOT_DLL is required for mingw-w64 unless shared lib is being built.

Bye.

-------------- next part --------------
diff -ru bdwgc/include/private/gcconfig.h updated/bdwgc/include/private/gcconfig.h
--- bdwgc/include/private/gcconfig.h	2008-10-25 17:24:19.000000000 +0400
+++ updated/bdwgc/include/private/gcconfig.h	2008-11-07 11:23:54.000000000 +0300
@@ -400,7 +400,7 @@
 #   define CYGWIN32
 #   define mach_type_known
 # endif
-# if defined(__MINGW32__)
+# if defined(__MINGW32__) && !defined(mach_type_known)
 #   define I386
 #   define MSWIN32
 #   define mach_type_known
diff -ru bdwgc/mark.c updated/bdwgc/mark.c
--- bdwgc/mark.c	2008-10-30 18:04:22.000000000 +0300
+++ updated/bdwgc/mark.c	2008-11-07 16:48:36.000000000 +0300
@@ -277,7 +277,8 @@
 
 static void alloc_mark_stack(size_t);
 
-# if defined(MSWIN32) || defined(USE_PROC_FOR_LIBRARIES) && defined(THREADS)
+# if defined(MSWIN32) && (!defined(__GNUC__) || !defined(_WIN64)) \
+	|| defined(USE_PROC_FOR_LIBRARIES) && defined(THREADS)
     /* 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.				     */
@@ -424,7 +425,7 @@
 }
 
 
-#if defined(MSWIN32) && defined(__GNUC__)
+#if defined(MSWIN32) && defined(__GNUC__) && !defined(_WIN64)
 
     typedef struct {
       EXCEPTION_REGISTRATION ex_reg;


More information about the Gc mailing list