chiark / gitweb /
configure.ac, lib/mem.c: Compatibility with older versions of libgc.
authorMark Wooding <mdw@distorted.org.uk>
Thu, 31 Dec 2015 20:49:02 +0000 (20:49 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Thu, 31 Dec 2015 20:49:02 +0000 (20:49 +0000)
The `GC_get_all_interior_pointers()' function and its friends were
introduced after the libgc in Debian wheezy (which is quite impressive
seeing as they were added in 2009).  Make sure it's there; use the old
now-deprecated variable directly if it isn't.

configure.ac
lib/mem.c

index 1491c67..e93d7a4 100644 (file)
@@ -437,6 +437,7 @@ AC_SUBST([finkbindir])
 # and report them all at once.
 AC_CHECK_LIB(gc, GC_malloc,            [AC_SUBST(LIBGC,[-lgc])],
             [missing_libraries="$missing_libraries libgc"])
+AC_CHECK_FUNCS(GC_get_all_interior_pointers)
 AC_CHECK_LIB(gcrypt, gcry_md_open,
              [AC_SUBST(LIBGCRYPT,[-lgcrypt])],
             [missing_libraries="$missing_libraries libgcrypt"])
index c191a5a..22b7228 100644 (file)
--- a/lib/mem.c
+++ b/lib/mem.c
@@ -72,7 +72,11 @@ void mem_init(void) {
     do_free = free;
   } else {
     GC_init();
+#ifdef HAVE_GC_GET_ALL_INTERIOR_POINTERS
     assert(GC_get_all_interior_pointers());
+#else
+    assert(GC_all_interior_pointers);
+#endif
   }
 #endif
 }