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

Adjust to match changes in libgc's CVS (pre-7.2).

In libgc CVS the `GC_do_blocking ()' declaration is now public but it
uses a slightly different signature for its first argument.

* configure.ac: Check for `GC_fn_type'.

* libguile/threads.c (GC_fn_type)[HAVE_GC_DO_BLOCKING &&
  !HAVE_GC_FN_TYPE]: New typedef.
  (scm_without_guile): Explicitly cast `without_guile_trampoline' to
  `GC_fn_type'.  This is because the upstream definition currently
  looks like `typedef void * (extern *GC_fn_type)(void *);', which
  isn't compatible.
This commit is contained in:
Ludovic Courtès 2009-10-09 14:42:07 +02:00
parent 705edb959b
commit 3d1af79fec
2 changed files with 22 additions and 9 deletions

View file

@ -1193,6 +1193,13 @@ AC_CHECK_DECL([GC_do_blocking],
[],
[#include <gc/gc.h>])
# `GC_fn_type' is not available in GC 7.1 and earlier.
AC_CHECK_TYPE([GC_fn_type],
[AC_DEFINE([HAVE_GC_FN_TYPE], [1],
[Define this if the `GC_fn_type' type is available.])],
[],
[#include <gc/gc.h>])
AC_CHECK_SIZEOF(float)
if test "$ac_cv_sizeof_float" -le "$ac_cv_sizeof_long"; then

View file

@ -745,14 +745,18 @@ scm_i_with_guile_and_parent (void *(*func)(void *), void *data, SCM parent)
/*** Non-guile mode. */
#if (defined HAVE_GC_DO_BLOCKING) && (!defined HAVE_DECL_GC_DO_BLOCKING)
/* This declaration is missing from the public headers of GC 7.1. */
extern void GC_do_blocking (void (*) (void *), void *);
#endif
#ifdef HAVE_GC_DO_BLOCKING
# ifndef HAVE_GC_FN_TYPE
/* This typedef is missing from the public headers of GC 7.1 and earlier. */
typedef void * (* GC_fn_type) (void *);
# endif /* HAVE_GC_FN_TYPE */
# ifndef HAVE_DECL_GC_DO_BLOCKING
/* This declaration is missing from the public headers of GC 7.1. */
extern void GC_do_blocking (GC_fn_type, void *);
# endif /* HAVE_DECL_GC_DO_BLOCKING */
struct without_guile_arg
{
void * (*function) (void *);
@ -772,7 +776,9 @@ without_guile_trampoline (void *closure)
SCM_I_CURRENT_THREAD->guile_mode = 1;
}
#endif
#endif /* HAVE_GC_DO_BLOCKING */
void *
scm_without_guile (void *(*func)(void *), void *data)
@ -786,7 +792,7 @@ scm_without_guile (void *(*func)(void *), void *data)
arg.function = func;
arg.data = data;
GC_do_blocking (without_guile_trampoline, &arg);
GC_do_blocking ((GC_fn_type) without_guile_trampoline, &arg);
result = arg.result;
}
else