1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 03:30:27 +02:00

fix compilation with libgc 7.0, 7.1

* configure.ac: Check for GC_pthread_exit and GC_pthread_cancel.

* libguile/gen-scmconfig.c: Write HAVE_GC_PTHREAD_CANCEL and
  HAVE_GC_PTHREAD_EXIT into scmconfig.h.

* libguile/pthread-threads.h (scm_i_pthread_exit, scm_i_pthread_cancel):
  Only redefine to their GC_pthread_* variants if we have those
  functions, which is not the case in libgc < 7.2.
This commit is contained in:
Andy Wingo 2011-03-29 13:21:44 +02:00
parent fb6df3ea13
commit 8cf49d836f
3 changed files with 24 additions and 1 deletions

View file

@ -1238,7 +1238,7 @@ save_LIBS="$LIBS"
LIBS="$BDW_GC_LIBS $LIBS"
CFLAGS="$BDW_GC_CFLAGS $CFLAGS"
AC_CHECK_FUNCS([GC_do_blocking GC_call_with_gc_active])
AC_CHECK_FUNCS([GC_do_blocking GC_call_with_gc_active GC_pthread_exit GC_pthread_cancel])
# Though the `GC_do_blocking ()' symbol is present in GC 7.1, it is not
# declared, and has a different type (returning void instead of

View file

@ -318,6 +318,18 @@ main (int argc, char *argv[])
pf ("#define SCM_NEED_BRACES_ON_PTHREAD_MUTEX_INITIALIZER %d /* 0 or 1 */\n",
SCM_I_GSC_NEED_BRACES_ON_PTHREAD_MUTEX_INITIALIZER);
#ifdef HAVE_GC_PTHREAD_CANCEL
pf ("#define SCM_HAVE_GC_PTHREAD_CANCEL 1 /* 0 or 1 */\n");
#else
pf ("#define SCM_HAVE_GC_PTHREAD_CANCEL 0 /* 0 or 1 */\n");
#endif
#ifdef HAVE_GC_PTHREAD_EXIT
pf ("#define SCM_HAVE_GC_PTHREAD_EXIT 1 /* 0 or 1 */\n");
#else
pf ("#define SCM_HAVE_GC_PTHREAD_EXIT 0 /* 0 or 1 */\n");
#endif
pf ("\n\n/*** File system access ***/\n");
pf ("/* Define to 1 if `struct dirent64' is available. */\n");

View file

@ -38,8 +38,19 @@
#define scm_i_pthread_self pthread_self
#define scm_i_pthread_create GC_pthread_create
#define scm_i_pthread_detach GC_pthread_detach
#if SCM_HAVE_GC_PTHREAD_EXIT
#define scm_i_pthread_exit GC_pthread_exit
#else
#define scm_i_pthread_exit pthread_exit
#endif
#if SCM_HAVE_GC_PTHREAD_CANCEL
#define scm_i_pthread_cancel GC_pthread_cancel
#else
#define scm_i_pthread_cancel pthread_cancel
#endif
#define scm_i_pthread_cleanup_push pthread_cleanup_push
#define scm_i_pthread_cleanup_pop pthread_cleanup_pop
#define scm_i_sched_yield sched_yield