From 9b00cd3d8f75a40daba31e45f1f995ab04102b30 Mon Sep 17 00:00:00 2001 From: "Steven G. Johnson" Date: Wed, 28 Aug 2013 11:51:51 -0400 Subject: [PATCH] work around guile 1.8+ swig problems --- configure.ac | 4 ++-- swig/nlopt-guile.i | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index b6626fe..a6eedfd 100644 --- a/configure.ac +++ b/configure.ac @@ -367,10 +367,10 @@ dnl add gcc warnings, in debug/maintainer mode only if test "$enable_debug" = yes || test "$USE_MAINTAINER_MODE" = yes; then if test $ac_cv_prog_gcc = yes; then if test "$ac_test_CFLAGS" != "set"; then - CFLAGS="$CFLAGS -Wall -W -Wcast-qual -Wpointer-arith -Wcast-align -pedantic -Wshadow -Wbad-function-cast -Wwrite-strings -Wstrict-prototypes -Wredundant-decls -Wnested-externs -Wundef -Wconversion -Wmissing-prototypes -Wmissing-declarations" + CFLAGS="$CFLAGS -Wall -W -Wcast-qual -Wpointer-arith -Wcast-align -Wno-long-long -pedantic -Wshadow -Wbad-function-cast -Wwrite-strings -Wstrict-prototypes -Wredundant-decls -Wnested-externs -Wundef -Wconversion -Wmissing-prototypes -Wmissing-declarations" fi if test "$ac_test_CXXFLAGS" != "set"; then - CXXFLAGS="$CXXFLAGS -Wall -W -Wcast-qual -Wpointer-arith -Wcast-align -pedantic -Wshadow -Wwrite-strings -Wredundant-decls -Wundef -Wconversion" + CXXFLAGS="$CXXFLAGS -Wall -W -Wcast-qual -Wpointer-arith -Wcast-align -Wno-long-long -pedantic -Wshadow -Wwrite-strings -Wredundant-decls -Wundef -Wconversion" fi if test "x$with_cxx" = xyes; then CFLAGS=$CXXFLAGS diff --git a/swig/nlopt-guile.i b/swig/nlopt-guile.i index d9987a3..c3eb297 100644 --- a/swig/nlopt-guile.i +++ b/swig/nlopt-guile.i @@ -1,5 +1,14 @@ // -*- C++ -*- +%{ +// work around obsolete stuff used by swig guile +#if SCM_MAJOR_VERSION >= 2 +# define gh_symbol2scm scm_from_latin1_symbol +#else +# define gh_symbol2scm scm_str2symbol +#endif +%} + %typemap(throws) std::runtime_error %{ scm_throw(gh_symbol2scm("runtime-error"), scm_list_1(scm_from_locale_string(($1).what()))); -- 2.30.2