Ensure that SWIG_VERSION is defined both at SWIG-time and in the generated C/C++ wrapper code (it was only defined in the wrapper for some target languages previously). SWIGGO and SWIGJAVASCRIPT are now defined in the generated wrappers to match behaviour for all other target languages. Stop defining SWIGVERSION in the wrapper. This only happened as a side-effect of how SWIG_VERSION was defined but was never documented and is redundant. The new testcase also checks that SWIG is defined at SWIG-time but not in the generated wrapper, and that exactly one of a list of target-language specific macros is defined. Fixes #1050
27 lines
718 B
C
27 lines
718 B
C
/* This list will need updating when new target languages are added. */
|
|
#if (0\
|
|
+defined(SWIGCSHARP)\
|
|
+defined(SWIGD)\
|
|
+defined(SWIGGO)\
|
|
+defined(SWIGGUILE)\
|
|
+defined(SWIGJAVA)\
|
|
+defined(SWIGJAVASCRIPT)\
|
|
+defined(SWIGLUA)\
|
|
+defined(SWIGMZSCHEME)\
|
|
+defined(SWIGOCAML)\
|
|
+defined(SWIGOCTAVE)\
|
|
+defined(SWIGPERL)\
|
|
+defined(SWIGPHP)\
|
|
+defined(SWIGPYTHON)\
|
|
+defined(SWIGR)\
|
|
+defined(SWIGRUBY)\
|
|
+defined(SWIGSCILAB)\
|
|
+defined(SWIGTCL)\
|
|
+defined(SWIGXML)\
|
|
) != 1
|
|
# ifdef SWIG
|
|
# error Did not detect exactly one target-language-specific macro defined at SWIG time.
|
|
# else
|
|
# error Did not detect exactly one target-language-specific macro defined in the generated wrapper.
|
|
# endif
|
|
#endif
|