summaryrefslogtreecommitdiff
path: root/guile.c
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2013-09-29 13:16:21 -0400
committerPaul Smith <psmith@gnu.org>2013-09-29 13:16:21 -0400
commit3bf3fde98470549800147c6390fde17791862e1d (patch)
treeaa92a85b8b03d9a1d23723b5785cbaa017bf8801 /guile.c
parent543521cd475e7182e30a17bd032b9fe2bb740bcb (diff)
downloadgunmake-3bf3fde98470549800147c6390fde17791862e1d.tar.gz
Portability for Guile 1.8. Force UTF-8 encoding.
Diffstat (limited to 'guile.c')
-rw-r--r--guile.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/guile.c b/guile.c
index 9c9bf5c..142c321 100644
--- a/guile.c
+++ b/guile.c
@@ -24,6 +24,15 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
#include <libguile.h>
+/* Pre-2.0 versions of Guile don't have a typedef for gsubr function types. */
+#if SCM_MAJOR_VERSION < 2
+# define GSUBR_TYPE SCM (*) ()
+/* Guile 1.x doesn't really support i18n. */
+# define scm_from_utf8_string(_s) (_s)
+#else
+# define GSUBR_TYPE scm_t_subr
+#endif
+
static SCM make_mod = SCM_EOL;
static SCM obj_to_str = SCM_EOL;
@@ -72,10 +81,10 @@ guile_define_module (void *data UNUSED)
#include "gmk-default.h"
/* Register a subr for GNU make's eval capability. */
- scm_c_define_gsubr ("gmk-expand", 1, 0, 0, (scm_t_subr) guile_expand_wrapper);
+ scm_c_define_gsubr ("gmk-expand", 1, 0, 0, (GSUBR_TYPE) guile_expand_wrapper);
/* Register a subr for GNU make's eval capability. */
- scm_c_define_gsubr ("gmk-eval", 1, 0, 0, (scm_t_subr) guile_eval_wrapper);
+ scm_c_define_gsubr ("gmk-eval", 1, 0, 0, (GSUBR_TYPE) guile_eval_wrapper);
/* Define the rest of the module. */
scm_c_eval_string (GUILE_module_defn);
@@ -100,7 +109,7 @@ guile_init (void *arg UNUSED)
static void *
internal_guile_eval (void *arg)
{
- return cvt_scm_to_str (scm_c_eval_string (arg));
+ return cvt_scm_to_str (scm_eval_string (scm_from_utf8_string (arg)));
}
/* This is the function registered with make */