From 689cbc06136a648ebde2c00e5dbab148026b5b00 Mon Sep 17 00:00:00 2001 From: David Hampton Date: Sat, 20 May 2006 02:02:20 +0000 Subject: [PATCH] Make the removal of scm_block_gc conditional on having guile 1.8 installed. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14137 57a11ea4-9604-0410-9ed3-97b8803252fd --- ChangeLog | 5 +++++ configure.in | 6 +++++- macros/legacy_macros.m4 | 2 +- src/engine/engine-helpers.c | 15 +++++++++++++++ 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8a7eb77e58..14b9e66f3a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2006-05-19 David Hampton + * src/engine/engine-helpers.c: + * macros/legacy_macros.m4: + * configure.in: Make the removal of scm_block_gc conditional on + having guile 1.8 installed. + * src/engine/engine-helpers.c: More of the patch from Bill Nottingham for compiling with guile 1.8. diff --git a/configure.in b/configure.in index 200e2b07ba..c961624e22 100644 --- a/configure.in +++ b/configure.in @@ -243,7 +243,7 @@ AC_SUBST(GUILE_LIBS) G_WRAP_COMPILE_ARGS="" G_WRAP_LINK_ARGS="" -AM_GUILE_VERSION_CHECK(1.6, , , [AC_MSG_ERROR([ +AM_GUILE_VERSION_CHECK(1.6.0, , , [AC_MSG_ERROR([ guile does not appear to be installed correctly, or is not in the correct version range. Perhaps you have not installed the guile @@ -258,6 +258,10 @@ AC_DEFINE_UNQUOTED(GNC_GUILE_MINOR_VERSION, ${guile_minor_version}, AC_DEFINE_UNQUOTED(GNC_GUILE_MICRO_VERSION, ${guile_micro_version}, [Guile Micro version number]) +AM_GUILE_VERSION_CHECK(1.8.0, , [ + AC_DEFINE(HAVE_GUILE18,1,[System has guile 1.8 or better]) +], ) + AM_PATH_GWRAP(1.3.3, , [AC_MSG_ERROR([ g-wrap does not appear to be installed correctly, or is not new diff --git a/macros/legacy_macros.m4 b/macros/legacy_macros.m4 index 10dd00eb57..6a9b60f5be 100644 --- a/macros/legacy_macros.m4 +++ b/macros/legacy_macros.m4 @@ -65,7 +65,7 @@ fi if test -n "$version_ok"; then AC_MSG_RESULT(yes: $guile_vers_string) - ifelse([$3], , true, [$4]) + ifelse([$3], , true, [$3]) else AC_MSG_RESULT(no: $guile_vers_string) diff --git a/src/engine/engine-helpers.c b/src/engine/engine-helpers.c index 42c28f20e1..d439cdf5a0 100644 --- a/src/engine/engine-helpers.c +++ b/src/engine/engine-helpers.c @@ -1686,6 +1686,10 @@ gnc_query2scm (QofQuery *q) if (!q) return SCM_BOOL_F; +#ifndef HAVE_GUILE18 + ++scm_block_gc; +#endif + /* terms */ pair = scm_cons (gnc_query_terms2scm (qof_query_get_terms (q)), SCM_EOL); pair = scm_cons (scm_str2symbol ("terms"), pair); @@ -1721,6 +1725,9 @@ gnc_query2scm (QofQuery *q) /* Reverse this list; tag it as 'query-v2' */ pair = scm_reverse (query_scm); +#ifndef HAVE_GUILE18 + --scm_block_gc; +#endif return scm_cons (scm_str2symbol ("query-v2"), pair); } @@ -1925,6 +1932,10 @@ gnc_scm2query_v2 (SCM query_scm) gboolean si1 = TRUE, si2 = TRUE, si3 = TRUE; int max_results = -1; +#ifndef HAVE_GUILE18 + ++scm_block_gc; +#endif + while (!SCM_NULLP (query_scm)) { const gchar *symbol; @@ -2003,6 +2014,10 @@ gnc_scm2query_v2 (SCM query_scm) } } +#ifndef HAVE_GUILE18 + --scm_block_gc; +#endif + if (ok && search_for) { qof_query_search_for (q, search_for); qof_query_set_sort_order (q, sp1, sp2, sp3);