aboutsummaryrefslogtreecommitdiff
path: root/Source/Modules/main.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Modules/main.cxx')
-rw-r--r--Source/Modules/main.cxx12
1 files changed, 7 insertions, 5 deletions
diff --git a/Source/Modules/main.cxx b/Source/Modules/main.cxx
index aa7e83ef8..f3aff2349 100644
--- a/Source/Modules/main.cxx
+++ b/Source/Modules/main.cxx
@@ -29,10 +29,6 @@
static Language *lang = 0; // Language method
int CPlusPlus = 0;
-extern "C"
-{
- int CPlusPlusOut = 0; // Generate C++ compatible code when wrapping C code
-}
int Extend = 0; // Extend flag
int ForceExtern = 0; // Force extern mode
int GenerateDefault = 1; // Generate default constructors
@@ -488,7 +484,8 @@ void SWIG_getoptions(int argc, char *argv[]) {
Swig_cparse_cplusplus(1);
Swig_mark_arg(i);
} else if (strcmp(argv[i], "-c++out") == 0) {
- CPlusPlusOut = 1;
+ // Undocumented
+ Swig_cparse_cplusplusout(1);
Swig_mark_arg(i);
} else if (strcmp(argv[i], "-fcompact") == 0) {
Wrapper_compact_print_mode_set(1);
@@ -955,6 +952,11 @@ int SWIG_main(int argc, char *argv[], Language *l) {
// Don't check for an input file if -external-runtime is passed
Swig_check_options(external_runtime ? 0 : 1);
+ if (CPlusPlus && cparse_cplusplusout) {
+ Printf(stderr, "The -c++out option is for C input but C++ input has been requested via -c++\n");
+ SWIG_exit(EXIT_FAILURE);
+ }
+
install_opts(argc, argv);
// Add language dependent directory to the search path