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 a revert of commit fc79264a48:
"Revert "Remove -cppcast and -nocppcast command line options""

The Scilab and Javascript casting problems are now fixed, so -cppcast
is now switched on as default.
This commit is contained in:
William S Fulton 2018-11-13 07:36:09 +00:00
commit 027a38c71c
7 changed files with 45 additions and 87 deletions

View file

@ -76,7 +76,6 @@ public:
* ------------------------------------------------------------ */
virtual void main(int argc, char *argv[]) {
int cppcast = 1;
SWIG_library_directory("tcl");
@ -106,22 +105,19 @@ public:
} else if (strcmp(argv[i], "-nosafe") == 0) {
nosafe = 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], "-help") == 0) {
fputs(usage, stdout);
} else if (strcmp(argv[i], "-cppcast") == 0) {
Printf(stderr, "Deprecated command line option: %s. This option is now always on.\n", argv[i]);
Swig_mark_arg(i);
} else if (strcmp(argv[i], "-nocppcast") == 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);
}
Preprocessor_define("SWIGTCL 1", 0);
// SWIGTCL8 is deprecated, and no longer documented.
Preprocessor_define("SWIGTCL8 1", 0);