From 39e2f975ccbce8521bbaa05c46977bae769a0fc0 Mon Sep 17 00:00:00 2001 From: Marcelo Matus Date: Thu, 21 Oct 2004 18:37:39 +0000 Subject: [PATCH] Add flag to enabla new C++ casting operators git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6470 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Lib/python/pymacros.swg | 8 ++++---- Source/Modules/python.cxx | 5 +++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Lib/python/pymacros.swg b/Lib/python/pymacros.swg index 8fcc50400..eb7fddb3f 100644 --- a/Lib/python/pymacros.swg +++ b/Lib/python/pymacros.swg @@ -30,12 +30,12 @@ #define SWIG_CCode_frag(Type...) SWIG_StringType(TYPECHECK, Type) /* Internal C/C++ API */ -#ifndef SWIG_NO_CPLUSPLUS_CAST +#ifdef SWIG_NO_CPLUSPLUS_CAST /* ----------------------------------------------------------------------------- - * Enable 'modern' cplusplus casting operators + * Disable 'modern' cplusplus casting operators * ----------------------------------------------------------------------------- */ -#ifndef SWIG_CPLUSPLUS_CAST -#define SWIG_CPLUSPLUS_CAST +#ifdef SWIG_CPLUSPLUS_CAST +#undef SWIG_CPLUSPLUS_CAST #endif #endif diff --git a/Source/Modules/python.cxx b/Source/Modules/python.cxx index daf4116eb..1247dae18 100644 --- a/Source/Modules/python.cxx +++ b/Source/Modules/python.cxx @@ -70,6 +70,7 @@ Python Options (available with -python)\n\ -interface - Set the lib name to \n\ -keyword - Use keyword arguments\n\ -classic - Use classic classes only\n\ + -cpluscast - Enable new C++ casting operators, useful for debugging\n\ -modern - Use modern python features only, without compatibility code\n\ -apply - Use apply() in proxy classes\n\ -new_vwm - New value wrapper mode, use only when everything else fails \n\ @@ -138,6 +139,10 @@ public: } else if (strcmp(argv[i],"-classic") == 0) { classic = 1; Swig_mark_arg(i); + } else if (strcmp(argv[i],"-cpluscast") == 0) { + /* Turn on new value wrapper mpde */ + Preprocessor_define((DOH *) "SWIG_CPLUSPLUS_CAST", 0); + Swig_mark_arg(i); } else if (strcmp(argv[i],"-modern") == 0) { classic = 0; modern = 1;