Create director_common.swg for language-indep code

Move -DSWIG_DIRECTOR_STATIC handling there, so this is now supported for
all languages with director support, not just Python and PHP.
This commit is contained in:
Olly Betts 2015-03-12 19:51:11 +13:00
commit 7ba0652677
13 changed files with 30 additions and 20 deletions

View file

@ -5,6 +5,10 @@ See the RELEASENOTES file for a summary of changes in each release.
Version 3.0.6 (in progress)
===========================
2015-03-12: olly
-DSWIG_DIRECTOR_STATIC is now supported for all languages with
director support, not only Python and PHP.
2015-03-02: ianlancetaylor
[Go] Add -cgo option, required for Go versions 1.5 and
later.

15
Lib/director_common.swg Normal file
View file

@ -0,0 +1,15 @@
/* -----------------------------------------------------------------------------
* director_common.swg
*
* This file contains support for director classes which is common between
* languages.
* ----------------------------------------------------------------------------- */
/*
Use -DSWIG_DIRECTOR_STATIC if you prefer to avoid the use of the
'Swig' namespace. This could be useful for multi-modules projects.
*/
#ifdef SWIG_DIRECTOR_STATIC
/* Force anonymous (static) namespace */
#define Swig
#endif

View file

@ -12,15 +12,6 @@
#include <exception>
#include <map>
/*
Use -DSWIG_DIRECTOR_STATIC if you prefer to avoid the use of the
'Swig' namespace. This could be useful for multi-modules projects.
*/
#ifdef SWIG_DIRECTOR_STATIC
/* Force anonymous (static) namespace */
#define Swig
#endif
namespace Swig {
/* memory handler */

View file

@ -40,16 +40,6 @@
#endif
/*
Use -DSWIG_DIRECTOR_STATIC if you prefer to avoid the use of the
'Swig' namespace. This could be useful for multi-modules projects.
*/
#ifdef SWIG_DIRECTOR_STATIC
/* Force anonymous (static) namespace */
#define Swig
#endif
/*
Use -DSWIG_DIRECTOR_NORTTI if you prefer to avoid the use of the
native C++ RTTI and dynamic_cast<>. But be aware that directors

View file

@ -418,6 +418,7 @@ public:
if (directorsEnabled()) {
// Insert director runtime into the f_runtime file (make it occur before %header section)
Swig_insert_file("director_common.swg", f_runtime);
Swig_insert_file("director.swg", f_runtime);
}
// Generate the intermediary class

View file

@ -508,6 +508,7 @@ public:
if (directorsEnabled()) {
// Insert director runtime into the f_runtime file (before %header section).
Swig_insert_file("director_common.swg", f_runtime);
Swig_insert_file("director.swg", f_runtime);
}

View file

@ -481,6 +481,7 @@ public:
if (directorsEnabled()) {
// Insert director runtime into the f_runtime file (make it occur before %header section)
Swig_insert_file("director_common.swg", f_runtime);
Swig_insert_file("director.swg", f_runtime);
}
// Generate the intermediary class

View file

@ -325,6 +325,7 @@ public:
if (directorsEnabled()) {
// Insert director runtime into the f_runtime file (make it occur before %header section)
Swig_insert_file("director_common.swg", f_runtime);
Swig_insert_file("director.swg", f_runtime);
}

View file

@ -228,8 +228,10 @@ public:
if (Len(docs))
emit_doc_texinfo();
if (directorsEnabled())
if (directorsEnabled()) {
Swig_insert_file("director_common.swg", f_runtime);
Swig_insert_file("director.swg", f_runtime);
}
Printf(f_init, "return true;\n}\n");
Printf(s_global_tab, "{0,0,0,0,0}\n};\n");

View file

@ -470,6 +470,7 @@ public:
if (directorsEnabled()) {
// Insert director runtime into the f_runtime file (make it occur before %header section)
Swig_insert_file("director_common.swg", f_runtime);
Swig_insert_file("director.swg", f_runtime);
}

View file

@ -473,6 +473,7 @@ public:
if (directorsEnabled()) {
// Insert director runtime
Swig_insert_file("director_common.swg", s_header);
Swig_insert_file("director.swg", s_header);
}

View file

@ -967,6 +967,7 @@ public:
if (directorsEnabled()) {
// Insert director runtime into the f_runtime file (make it occur before %header section)
Swig_insert_file("director_common.swg", f_runtime);
Swig_insert_file("director.swg", f_runtime);
}

View file

@ -1171,6 +1171,7 @@ public:
if (directorsEnabled()) {
// Insert director runtime into the f_runtime file (make it occur before %header section)
Swig_insert_file("director_common.swg", f_runtime);
Swig_insert_file("director.swg", f_runtime);
}