Remove -cppcast and -nocppcast command line options

The -cppcast option is still turned on by default. The -nocppcast option
to turn off the use of c++ casts (const_cast, static_cast etc) has been
removed. However, defining SWIG_NO_CPLUSPLUS_CAST will still generate C casts
instead of C++ casts for C++ wrappers.
This commit is contained in:
William S Fulton 2018-10-25 08:07:08 +01:00
commit c06f2b4497
7 changed files with 45 additions and 87 deletions

View file

@ -110,7 +110,6 @@ static const char *usage1 = "\
Python Options (available with -python)\n\
-builtin - Create new python built-in types, rather than proxy classes, for better performance\n\
-castmode - Enable the casting mode, which allows implicit cast between types in python\n\
-cppcast - Enable C++ casting operators (default) \n\
-dirvtable - Generate a pseudo virtual table for directors for faster dispatch \n\
-doxygen - Convert C++ doxygen comments to pydoc comments in proxy classes \n\
-debug-doxygen-parser - Display doxygen parser module debugging information\n\
@ -123,7 +122,6 @@ Python Options (available with -python)\n\
static const char *usage2 = "\
-newvwm - New value wrapper mode, use only when everything else fails \n\
-nocastmode - Disable the casting mode (default)\n\
-nocppcast - Disable C++ casting operators, useful for generating bugs\n\
-nodirvtable - Don't use the virtual table feature, resolve the python method each time (default)\n\
-noexcept - No automatic exception handling\n\
-noextranative - Don't use extra native C++ wraps for std containers when possible (default) \n\
@ -310,7 +308,6 @@ public:
* ------------------------------------------------------------ */
virtual void main(int argc, char *argv[]) {
int cppcast = 1;
SWIG_library_directory("python");
@ -350,12 +347,6 @@ public:
use_kw = 1;
SWIG_cparse_set_compact_default_args(1);
Swig_mark_arg(i);
} else if (strcmp(argv[i], "-cppcast") == 0) {
cppcast = 1;
Swig_mark_arg(i);
} else if (strcmp(argv[i], "-nocppcast") == 0) {
cppcast = 0;
Swig_mark_arg(i);
} else if (strcmp(argv[i], "-outputtuple") == 0) {
outputtuple = 1;
Swig_mark_arg(i);
@ -443,7 +434,8 @@ public:
} else if (strcmp(argv[i], "-relativeimport") == 0) {
relativeimport = 1;
Swig_mark_arg(i);
} else if (strcmp(argv[i], "-fastinit") == 0 ||
} else if (strcmp(argv[i], "-cppcast") == 0 ||
strcmp(argv[i], "-fastinit") == 0 ||
strcmp(argv[i], "-fastquery") == 0 ||
strcmp(argv[i], "-fastunpack") == 0 ||
strcmp(argv[i], "-modern") == 0 ||
@ -451,8 +443,9 @@ public:
strcmp(argv[i], "-noproxydel") == 0 ||
strcmp(argv[i], "-safecstrings") == 0) {
Printf(stderr, "Deprecated command line option: %s. This option is now always on.\n", argv[i]);
} else if (strcmp(argv[i], "-buildnone") == 0 ||
strcmp(argv[i], "-aliasobj0") == 0 ||
Swig_mark_arg(i);
} else if (strcmp(argv[i], "-aliasobj0") == 0 ||
strcmp(argv[i], "-buildnone") == 0 ||
strcmp(argv[i], "-classic") == 0 ||
strcmp(argv[i], "-classptr") == 0 ||
strcmp(argv[i], "-new_repr") == 0 ||
@ -460,6 +453,7 @@ public:
strcmp(argv[i], "-newrepr") == 0 ||
strcmp(argv[i], "-noaliasobj0") == 0 ||
strcmp(argv[i], "-nobuildnone") == 0 ||
strcmp(argv[i], "-nocppcast") == 0 ||
strcmp(argv[i], "-nofastinit") == 0 ||
strcmp(argv[i], "-nofastquery") == 0 ||
strcmp(argv[i], "-nomodern") == 0 ||
@ -469,16 +463,13 @@ public:
strcmp(argv[i], "-oldrepr") == 0 ||
strcmp(argv[i], "-proxydel") == 0) {
Printf(stderr, "Deprecated command line option: %s. This option is no longer supported.\n", argv[i]);
Swig_mark_arg(i);
SWIG_exit(EXIT_FAILURE);
}
}
}
if (cppcast) {
Preprocessor_define((DOH *) "SWIG_CPLUSPLUS_CAST", 0);
}
if (doxygen)
doxygenTranslator = new PyDocConverter(doxygen_translator_flags);