2009-02-28 Hans Boehm <Hans.Boehm@hp.com>
authorhboehm <hboehm>
Sun, 1 Mar 2009 01:52:59 +0000 (01:52 +0000)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 26 Jul 2011 17:06:44 +0000 (21:06 +0400)
* misc.c (GC_set_warn_proc): Implicitly intialize GC on
non-Cygwin win32.

ChangeLog
misc.c

index 2035b33..742c1dc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2009-02-28  Hans Boehm <Hans.Boehm@hp.com>
+       * misc.c (GC_set_warn_proc): Implicitly intialize GC on
+       non-Cygwin win32.
+
 2009-02-28  Hans Boehm <Hans.Boehm@hp.com> (Really Petr Krajca)
        * configure.ac: Enable thread-local allocation for sparc-linux.
        * configure: Regenerate.
diff --git a/misc.c b/misc.c
index df9dc20..1db1415 100644 (file)
--- a/misc.c
+++ b/misc.c
@@ -1032,7 +1032,12 @@ GC_API GC_warn_proc GC_CALL GC_set_warn_proc(GC_warn_proc p)
     GC_warn_proc result;
 
 #   ifdef GC_WIN32_THREADS
-      GC_ASSERT(GC_is_initialized);
+#     ifdef CYGWIN32
+       /* Need explicit GC_INIT call */
+        GC_ASSERT(GC_is_initialized);
+#     else
+       if (!GC_is_initialized) GC_init();
+#     endif
 #   endif
     LOCK();
     result = GC_current_warn_proc;