diff options
author | Paul Smith <psmith@gnu.org> | 2013-09-29 13:16:21 -0400 |
---|---|---|
committer | Paul Smith <psmith@gnu.org> | 2013-09-29 13:16:21 -0400 |
commit | 3bf3fde98470549800147c6390fde17791862e1d (patch) | |
tree | aa92a85b8b03d9a1d23723b5785cbaa017bf8801 /guile.c | |
parent | 543521cd475e7182e30a17bd032b9fe2bb740bcb (diff) | |
download | gunmake-3bf3fde98470549800147c6390fde17791862e1d.tar.gz |
Portability for Guile 1.8. Force UTF-8 encoding.
Diffstat (limited to 'guile.c')
-rw-r--r-- | guile.c | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -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 */ |