diff options
author | William S Fulton <wsf@fultondesigns.co.uk> | 2013-12-23 20:23:54 +0000 |
---|---|---|
committer | William S Fulton <wsf@fultondesigns.co.uk> | 2013-12-23 20:23:54 +0000 |
commit | 1a19451c1ba189319a0ced355c7e6b93eeb6957a (patch) | |
tree | bf0458c2c3a14b060493984f9fd4e104c70bb3c7 | |
parent | 135a7cc558442062ce8d65de834870a71eb30aca (diff) | |
download | swig-1a19451c1ba189319a0ced355c7e6b93eeb6957a.tar.gz |
Error out attempting to use directors without -c++
Remove redundant #ifdef __cplusplus markers in director.swg
-rw-r--r-- | Lib/csharp/director.swg | 5 | ||||
-rw-r--r-- | Lib/d/director.swg | 3 | ||||
-rw-r--r-- | Lib/java/director.swg | 3 | ||||
-rw-r--r-- | Lib/ocaml/director.swg | 3 | ||||
-rw-r--r-- | Lib/octave/director.swg | 1 | ||||
-rw-r--r-- | Lib/perl5/director.swg | 6 | ||||
-rw-r--r-- | Lib/php/director.swg | 4 | ||||
-rw-r--r-- | Lib/python/director.swg | 5 | ||||
-rw-r--r-- | Lib/ruby/director.swg | 5 | ||||
-rw-r--r-- | Source/CParse/parser.y | 3 |
10 files changed, 4 insertions, 34 deletions
diff --git a/Lib/csharp/director.swg b/Lib/csharp/director.swg index c68c2d98f..403a0ac34 100644 --- a/Lib/csharp/director.swg +++ b/Lib/csharp/director.swg @@ -5,8 +5,6 @@ * methods can be called from C++. * ----------------------------------------------------------------------------- */ -#ifdef __cplusplus - #if defined(DEBUG_DIRECTOR_OWNED) #include <iostream> #endif @@ -45,6 +43,3 @@ namespace Swig { }; } -#endif /* __cplusplus */ - - diff --git a/Lib/d/director.swg b/Lib/d/director.swg index d0ef2372b..6b6537103 100644 --- a/Lib/d/director.swg +++ b/Lib/d/director.swg @@ -5,8 +5,6 @@ * methods can be called from C++. * ----------------------------------------------------------------------------- */ -#ifdef __cplusplus - #if defined(DEBUG_DIRECTOR_OWNED) #include <iostream> #endif @@ -47,4 +45,3 @@ namespace Swig { }; } -#endif /* __cplusplus */ diff --git a/Lib/java/director.swg b/Lib/java/director.swg index 86880a55e..72f166406 100644 --- a/Lib/java/director.swg +++ b/Lib/java/director.swg @@ -5,8 +5,6 @@ * method calls from C++ to Java extensions. * ----------------------------------------------------------------------------- */ -#ifdef __cplusplus - #if defined(DEBUG_DIRECTOR_OWNED) || defined(DEBUG_DIRECTOR_EXCEPTION) #include <iostream> #endif @@ -384,4 +382,3 @@ namespace Swig { } -#endif /* __cplusplus */ diff --git a/Lib/ocaml/director.swg b/Lib/ocaml/director.swg index dc4c69b7d..0f997acd0 100644 --- a/Lib/ocaml/director.swg +++ b/Lib/ocaml/director.swg @@ -6,8 +6,6 @@ * * ----------------------------------------------------------------------------- */ -#ifdef __cplusplus - #include <string> # define SWIG_DIRECTOR_CAST(ARG) dynamic_cast<Swig::Director *>(ARG) @@ -100,4 +98,3 @@ namespace Swig { }; } -#endif /* __cplusplus */ diff --git a/Lib/octave/director.swg b/Lib/octave/director.swg index ce4377ef1..96bbf03cc 100644 --- a/Lib/octave/director.swg +++ b/Lib/octave/director.swg @@ -5,7 +5,6 @@ * methods can be called from C++. * ----------------------------------------------------------------------------- */ - # define SWIG_DIRECTOR_CAST(ARG) dynamic_cast<Swig::Director *>(ARG) namespace Swig { diff --git a/Lib/perl5/director.swg b/Lib/perl5/director.swg index 0e7faee6c..9fa64e147 100644 --- a/Lib/perl5/director.swg +++ b/Lib/perl5/director.swg @@ -8,8 +8,6 @@ #ifndef SWIG_DIRECTOR_PERL_HEADER_ #define SWIG_DIRECTOR_PERL_HEADER_ -#ifdef __cplusplus - #include <string> #include <iostream> #include <exception> @@ -316,7 +314,5 @@ namespace Swig { } -#endif /* __cplusplus */ - - #endif + diff --git a/Lib/php/director.swg b/Lib/php/director.swg index b864cff84..2b176ed09 100644 --- a/Lib/php/director.swg +++ b/Lib/php/director.swg @@ -8,8 +8,6 @@ #ifndef SWIG_DIRECTOR_PHP_HEADER_ #define SWIG_DIRECTOR_PHP_HEADER_ -#ifdef __cplusplus - #include <string> #include <map> @@ -171,6 +169,4 @@ namespace Swig { // so use a macro to insert TSRMLS_CC so any ZTS context gets passed. #define DirectorMethodException() DirectorMethodException("" TSRMLS_CC) -#endif /* __cplusplus */ - #endif diff --git a/Lib/python/director.swg b/Lib/python/director.swg index baa72c664..3eac683f9 100644 --- a/Lib/python/director.swg +++ b/Lib/python/director.swg @@ -8,8 +8,6 @@ #ifndef SWIG_DIRECTOR_PYTHON_HEADER_ #define SWIG_DIRECTOR_PYTHON_HEADER_ -#ifdef __cplusplus - #include <string> #include <iostream> #include <exception> @@ -432,7 +430,4 @@ namespace Swig { #endif } -#endif /* __cplusplus */ - - #endif diff --git a/Lib/ruby/director.swg b/Lib/ruby/director.swg index 360344f6c..23aa6da48 100644 --- a/Lib/ruby/director.swg +++ b/Lib/ruby/director.swg @@ -15,8 +15,6 @@ #endif #endif -#ifdef __cplusplus - #include <string> #include <iostream> #include <map> @@ -341,6 +339,3 @@ namespace Swig { }; } -#endif /* __cplusplus */ - - diff --git a/Source/CParse/parser.y b/Source/CParse/parser.y index 40d853387..d01c2fcd1 100644 --- a/Source/CParse/parser.y +++ b/Source/CParse/parser.y @@ -2024,6 +2024,9 @@ module_directive: MODULE options idstring { Setattr($$,"options",$2); if (Getattr($2,"directors")) { Wrapper_director_mode_set(1); + if (!cparse_cplusplus) { + Swig_error(cparse_file, cparse_line, "Directors are not supported for C code and require the -c++ option\n"); + } } if (Getattr($2,"dirprot")) { Wrapper_director_protected_mode_set(1); |