From fc79264a48f186f8bbd367e91fa9dbf9758aa092 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Tue, 6 Nov 2018 17:22:05 +0000 Subject: Revert "Remove -cppcast and -nocppcast command line options" This reverts commit c06f2b4497bffeb185dbf0e65dc925514537ef37. More work to be done as it breaks Scilab and Javascript tests. --- Lib/typemaps/swigmacros.swg | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'Lib/typemaps') diff --git a/Lib/typemaps/swigmacros.swg b/Lib/typemaps/swigmacros.swg index 687b0680e..3a63a256c 100644 --- a/Lib/typemaps/swigmacros.swg +++ b/Lib/typemaps/swigmacros.swg @@ -31,7 +31,7 @@ %as_voidptrptr(a) reinterpret_cast(a) or their C unsafe versions. In C++ we use the safe version unless - SWIG_NO_CPLUSPLUS_CAST is defined + SWIG_NO_CPLUSPLUS_CAST is defined (usually via the -nocppcast swig flag). Memory allocation: @@ -123,7 +123,14 @@ nocppval * Casting operators * ----------------------------------------------------------------------------- */ -#if defined(__cplusplus) && !defined(SWIG_NO_CPLUSPLUS_CAST) +#if defined(SWIG_NO_CPLUSPLUS_CAST) +/* Disable 'modern' cplusplus casting operators */ +# if defined(SWIG_CPLUSPLUS_CAST) +# undef SWIG_CPLUSPLUS_CAST +# endif +#endif + +#if defined(__cplusplus) && defined(SWIG_CPLUSPLUS_CAST) # define %const_cast(a,Type...) const_cast< Type >(a) # define %static_cast(a,Type...) static_cast< Type >(a) # define %reinterpret_cast(a,Type...) reinterpret_cast< Type >(a) -- cgit v1.2.1