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

@ -208,7 +208,6 @@ static void writeListByLine(List *l, File *out, bool quote = 0) {
static const char *usage = "\
R Options (available with -r)\n\
-copystruct - Emit R code to copy C structs (on by default)\n\
-cppcast - Enable C++ casting operators (default) \n\
-debug - Output debug\n\
-dll <name> - Name of the DLL (without the .dll or .so suffix).\n\
Default is the module name.\n\
@ -2695,7 +2694,6 @@ String * R::runtimeCode() {
Use Swig_mark_arg() to tell SWIG that it is understood and not to throw an error.
**/
void R::main(int argc, char *argv[]) {
bool cppcast = true;
init();
Preprocessor_define("SWIGR 1", 0);
SWIG_library_directory("r");
@ -2739,12 +2737,6 @@ void R::main(int argc, char *argv[]) {
} else if(!strcmp(argv[i], "-debug")) {
debugMode = true;
Swig_mark_arg(i);
} else if (!strcmp(argv[i],"-cppcast")) {
cppcast = true;
Swig_mark_arg(i);
} else if (!strcmp(argv[i],"-nocppcast")) {
cppcast = false;
Swig_mark_arg(i);
} else if (!strcmp(argv[i],"-copystruct")) {
copyStruct = true;
Swig_mark_arg(i);
@ -2763,10 +2755,13 @@ void R::main(int argc, char *argv[]) {
} else if (!strcmp(argv[i], "-noaggressivegc")) {
aggressiveGc = false;
Swig_mark_arg(i);
}
if (cppcast) {
Preprocessor_define((DOH *) "SWIG_CPLUSPLUS_CAST", 0);
} 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 (debugMode) {