Require guile 1.8.5 and remove all 1.6.x specific conditions

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@20441 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Geert Janssens
2011-03-21 15:10:40 +00:00
parent b3b2368af3
commit 14891d2849
7 changed files with 8 additions and 49 deletions

View File

@@ -403,11 +403,11 @@ fi
AS_SCRUB_INCLUDE(GUILE_INCS)
AC_SUBST(GUILE_LIBS)
AM_GUILE_VERSION_CHECK(1.6.7, , , [AC_MSG_ERROR([
AM_GUILE_VERSION_CHECK(1.8.5, , , [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
development packages? Gnucash requires at least version 1.6.7 to build.
development packages? Gnucash requires at least version 1.8.5 to build.
])])
AC_SUBST(GUILE)
@@ -418,10 +418,6 @@ 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])
], )
AS_SCRUB_INCLUDE(CFLAGS)
### Check size of long_long - some guile's are broken.

View File

@@ -105,7 +105,7 @@ void gnc_register_kvp_option_generator(QofIdType id_type, SCM generator);
break;
key = scm_to_locale_string (key_scm);
gkey = g_strdup (key);
gnc_free_scm_locale_string(key);
free (key);
path = g_list_prepend (path, gkey);
path_scm = SCM_CDR (path_scm);
}

View File

@@ -1327,6 +1327,6 @@ gchar *gnc_scm_to_locale_string(SCM scm_string)
/* scm_to_locale_string() returns a malloc'ed string in guile-1.8
(but not in guile-1.6). Copy to a g_malloc'ed one. */
s = g_strdup(x);
gnc_free_scm_locale_string(x);
free(x);
return s;
}

View File

@@ -1718,10 +1718,6 @@ 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);
@@ -1757,9 +1753,6 @@ 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);
}
@@ -2019,10 +2012,6 @@ 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_is_null (query_scm))
{
const gchar *symbol;
@@ -2123,10 +2112,6 @@ gnc_scm2query_v2 (SCM query_scm)
}
}
#ifndef HAVE_GUILE18
--scm_block_gc;
#endif
if (ok && search_for)
{
qof_query_search_for (q, search_for);

View File

@@ -141,7 +141,7 @@ gchar * gnc_build_book_path (const gchar *filename);
key = scm_to_locale_string (key_scm);
gkey = g_strdup (key);
gnc_free_scm_locale_string(key);
free (key);
path = g_list_prepend (path, gkey);

View File

@@ -184,7 +184,7 @@ gnc_extension_path (SCM extension, char **fullpath)
{
strings[i] = g_strdup(gettext(s));
}
gnc_free_scm_locale_string(s);
free(s);
}
else
{

View File

@@ -19,33 +19,11 @@
#include <libguile/version.h> /* for SCM_MAJOR_VERSION etc */
/* Give Guile 1.6 and 1.8 a 2.0-like interface */
#if (SCM_MAJOR_VERSION == 1) && (SCM_MINOR_VERSION <= 6)
# define scm_is_bool SCM_BOOLP
# define scm_is_false SCM_FALSEP
# define scm_is_null SCM_NULLP
# define scm_is_number SCM_NUMBERP
# define scm_is_pair SCM_CONSP
# define scm_is_string SCM_STRINGP
# define scm_is_symbol SCM_SYMBOLP
# define scm_is_true SCM_NFALSEP
# define scm_is_vector SCM_VECTORP
# define scm_c_string_length SCM_STRING_LENGTH
#elif (SCM_MAJOR_VERSION == 1) && (SCM_MINOR_VERSION <= 8)
/* Give Guile 1.8 a 2.0-like interface */
#if (SCM_MAJOR_VERSION == 1) && (SCM_MINOR_VERSION <= 8)
# define scm_c_string_length scm_i_string_length
#endif
/* The result of SCM_STRING_CHARS must not be free'd, but the result
* of scm_to_locale_string must. That's bad. We define the macro
* gnc_free_scm_locale_string to wrap around free() for that
* reason. */
#if (SCM_MAJOR_VERSION == 1) && (SCM_MINOR_VERSION <= 6)
# define scm_to_locale_string SCM_STRING_CHARS
# define gnc_free_scm_locale_string (void)
#else
# define gnc_free_scm_locale_string free
#endif
/* Convenience macros */
#define scm_is_equal(obj1,obj2) scm_is_true(scm_equal_p(obj1,obj2))