summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2017-04-20 10:40:07 +0200
committerAndy Wingo <wingo@pobox.com>2017-04-20 10:40:07 +0200
commit40df57a8a2b706bab0b2bda84dd2ce98f1be8e3b (patch)
tree2c713fad8a22183885d70ff81ccac83eab82c780
parent3db21f5eb9d966e65760db5683775c76e0a6c5b1 (diff)
downloadguile-40df57a8a2b706bab0b2bda84dd2ce98f1be8e3b.tar.gz
Restore libgc 7.2 compatibility
* configure.ac: Check for GC_is_heap_ptr, added after libgc 7.2. * libguile/pairs.h (GC_is_heap_ptr): Define a shim for GC_is_heap_ptr, inside BUILDING_LIBGUILE so as not to expose it to users.
-rw-r--r--configure.ac2
-rw-r--r--libguile/pairs.h8
2 files changed, 9 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 1338540c6..374b4297a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1346,7 +1346,7 @@ CFLAGS="$BDW_GC_CFLAGS $CFLAGS"
AC_CHECK_FUNCS([GC_pthread_exit GC_pthread_cancel GC_pthread_sigmask])
# Functions from GC 7.3.
-AC_CHECK_FUNCS([GC_move_disappearing_link])
+AC_CHECK_FUNCS([GC_move_disappearing_link GC_is_heap_ptr])
LIBS="$save_LIBS"
diff --git a/libguile/pairs.h b/libguile/pairs.h
index 08d6ad92c..121a76518 100644
--- a/libguile/pairs.h
+++ b/libguile/pairs.h
@@ -177,6 +177,14 @@ scm_cdr (SCM x)
#endif
#ifdef BUILDING_LIBGUILE
+#ifndef HAVE_GC_IS_HEAP_PTR
+static int
+GC_is_heap_ptr (void *ptr)
+{
+ return GC_base (ptr) != NULL;
+}
+#endif
+
static inline int
scm_is_mutable_pair (SCM x)
{