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

@ -19,8 +19,6 @@ static const char *usage = "\
Perl5 Options (available with -perl5)\n\
-compat - Compatibility mode\n\
-const - Wrap constants as constants and not variables (implies -proxy)\n\
-cppcast - Enable C++ casting operators\n\
-nocppcast - Disable C++ casting operators, useful for generating bugs\n\
-nopm - Do not generate the .pm file\n\
-noproxy - Don't create proxy classes\n\
-proxy - Create proxy classes\n\
@ -148,7 +146,6 @@ public:
virtual void main(int argc, char *argv[]) {
int i = 1;
int cppcast = 1;
SWIG_library_directory("perl5");
@ -189,25 +186,22 @@ public:
} else if (strcmp(argv[i],"-v") == 0) {
Swig_mark_arg(i);
verbose++;
} 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], "-compat") == 0) {
compat = 1;
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("SWIGPERL 1", 0);
// SWIGPERL5 is deprecated, and no longer documented.
Preprocessor_define("SWIGPERL5 1", 0);