diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2015-01-06 21:25:40 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2015-01-06 21:25:40 +0200 |
commit | ad8c9359649fa7123efc46a98c6cec0dd44f34c8 (patch) | |
tree | 7520e988989d32f68c67fc4345d32ea688799058 /src | |
parent | f6e7047f4ffa82b22425c57b23005c5af9dd5b4f (diff) | |
download | gamma-ad8c9359649fa7123efc46a98c6cec0dd44f34c8.tar.gz gamma-ad8c9359649fa7123efc46a98c6cec0dd44f34c8.tar.bz2 |
Update for Guile 2.0
* configure.ac (AM_C_PROTOTYPES): Remove.
* gint: Upgrade
* modules/expat (libgamma_expat_la_CPPFLAGS): Add AM_CPPFLAGS
* scripts/bootstrap: Fix deprecation warnings.
(grammar): Fix definition of --parents
* src/Makefile.am: Use AM_CPPFLAGS instead of INCLUDES
* src/eval.c (scheme_exec_data) <result> Remove.
(scheme_safe_exec_body): Return result.
(gamma_safe_exec): Use scm_c_catch instead of scm_internal_lazy_catch.
* src/gamma-expat.c (gamma_xml_parser_create)
(make_user_data): Use scm_malloc instead of scm_gc_malloc.
* src/expat.sci: Don't load (ice-9 syncase) when using Guile 2.0
* src/sql.sci: Likewise.
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile.am | 15 | ||||
-rw-r--r-- | src/eval.c | 15 | ||||
-rw-r--r-- | src/expat.sci | 5 | ||||
-rw-r--r-- | src/gamma-expat.c | 7 | ||||
-rw-r--r-- | src/sql.sci | 6 |
5 files changed, 26 insertions, 22 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index 6fc983a..c5caa7f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,5 +1,5 @@ # This file is part of Gamma. -# Copyright (C) 2002, 2007, 2010 Sergey Poznyakoff +# Copyright (C) 2002, 2007, 2010, 2015 Sergey Poznyakoff # # Gamma is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -14,15 +14,20 @@ # You should have received a copy of the GNU General Public License # along with Gamma. If not, see <http://www.gnu.org/licenses/>. -INCLUDES =-I$(top_builddir) -I$(srcdir) -I. @INCLUDEPATH@ +AM_CPPFLAGS =\ + -I$(top_builddir)\ + -I$(srcdir)\ + -I.\ + @INCLUDEPATH@\ + -DDATADIR=\"$(guiledir)\" -EXTRA_DIST= +EXTRA_DIST = modules.mk documentation.sci EXTRA_LTLIBRARIES= lib_LTLIBRARIES=@GAMMA_LIB_LIST@ install-data-hook: @GAMMA_INSTALL_HOOKS@ +MAINTAINERCLEANFILES= include modules.mk -EXTRA_DIST += modules.mk documentation.sci sitedir=$(GUILE_SITE)/$(PACKAGE) site_DATA=$(GAMMA_BUILT_DATA_FILES) documentation.scm @@ -36,8 +41,6 @@ DOT_DOC_FILES=$(DOT_X_FILES:.x=.doc) DISTCLEANFILES=$(site_DATA) -AM_CPPFLAGS=-DDATADIR=\"$(guiledir)\" - SUFFIXES= CLEANFILES= BUILT_SOURCES= @@ -1,5 +1,5 @@ /* This file is part of Gamma. - Copyright (C) 2010 Sergey Poznyakoff + Copyright (C) 2010, 2015 Sergey Poznyakoff Gamma is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -35,15 +35,13 @@ eval_catch_handler (void *data, SCM tag, SCM throw_args) struct scheme_exec_data { SCM (*handler) (void *data); void *data; - SCM result; }; static SCM scheme_safe_exec_body (void *data) { struct scheme_exec_data *ed = data; - ed->result = ed->handler(ed->data); - return SCM_BOOL_F; + return ed->handler(ed->data); } int @@ -51,16 +49,17 @@ gamma_safe_exec(SCM (*handler) (void *data), void *data, SCM *result) { jmp_buf jmp_env; struct scheme_exec_data ed; + SCM res; if (setjmp(jmp_env)) exit(70); /* EX_SOFTWARE */ ed.handler = handler; ed.data = data; - scm_internal_lazy_catch(SCM_BOOL_T, - scheme_safe_exec_body, (void*)&ed, - eval_catch_handler, &jmp_env); + res = scm_c_catch(SCM_BOOL_T, + scheme_safe_exec_body, (void*)&ed, + eval_catch_handler, &jmp_env, NULL, NULL); if (result) - *result = ed.result; + *result = res; return 0; } diff --git a/src/expat.sci b/src/expat.sci index 6f729fd..19e48fe 100644 --- a/src/expat.sci +++ b/src/expat.sci @@ -1,5 +1,5 @@ ;;;; This file is part of Gamma. -*- scheme -*- -;;;; Copyright (C) 2010 Sergey Poznyakoff +;;;; Copyright (C) 2010, 2015 Sergey Poznyakoff ;;;; ;;;; Gamma is free software; you can redistribute it and/or modify ;;;; it under the terms of the GNU General Public License as published by @@ -26,7 +26,8 @@ changequote([,])dnl xml-set-handler) :export-syntax (xml-error-descr)) -(use-syntax (ice-9 syncase)) +(if (= (string->number (major-version)) 1) + (use-syntax (ice-9 syncase))) (let ((lib-path "LIBDIR/")) (load-extension (string-append diff --git a/src/gamma-expat.c b/src/gamma-expat.c index b70fe32..a81d30e 100644 --- a/src/gamma-expat.c +++ b/src/gamma-expat.c @@ -1,5 +1,5 @@ /* This file is part of Gamma. - Copyright (C) 2010 Sergey Poznyakoff + Copyright (C) 2010, 2015 Sergey Poznyakoff Gamma is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -32,7 +32,7 @@ gamma_xml_parser_create(XML_Parser parser) { struct gamma_xml_parser *gp; - gp = scm_gc_malloc(sizeof (*gp), "XML_Parser"); + gp = scm_malloc(sizeof (*gp)); gp->parser = parser; SCM_RETURN_NEWSMOB(gamma_xml_parser_tag, gp); } @@ -100,8 +100,7 @@ make_user_data () { int i; - struct gamma_expat_user_data *p = scm_gc_malloc(sizeof (*p), - "make_user_data"); + struct gamma_expat_user_data *p = scm_malloc(sizeof (*p)); for (i = 0; i < gamma_expat_handler_count; i++) p->handler[i] = SCM_UNSPECIFIED; p->external_entity_ref_handler_arg = SCM_UNSPECIFIED; diff --git a/src/sql.sci b/src/sql.sci index fd23795..ab91c00 100644 --- a/src/sql.sci +++ b/src/sql.sci @@ -1,5 +1,5 @@ ;;;; This file is part of Gamma. -*- scheme -*- -;;;; Copyright (C) 2002, 2008, 2010 Sergey Poznyakoff +;;;; Copyright (C) 2002, 2008, 2010, 2015 Sergey Poznyakoff ;;;; ;;;; Gamma is free software; you can redistribute it and/or modify ;;;; it under the terms of the GNU General Public License as published by @@ -19,7 +19,9 @@ changequote([,])dnl (define-module (gamma sql) :use-module (gamma documentation) :export-syntax (sql-catch-failure sql-ignore-failure)) -(use-syntax (ice-9 syncase)) + +(if (= (string->number (major-version)) 1) + (use-syntax (ice-9 syncase))) (let ((lib-path "LIBDIR/")) (load-extension (string-append |