From: Steven G. Johnson Date: Wed, 28 Aug 2013 15:51:51 +0000 (-0400) Subject: work around guile 1.8+ swig problems X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=9b00cd3d8f75a40daba31e45f1f995ab04102b30;p=nlopt.git work around guile 1.8+ swig problems --- 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())));