Do not export static global variables at all
They shouldn't be exported and can't be when using shared libraries.
This commit is contained in:
parent
75d9cb4769
commit
5fd1f28477
1 changed files with 4 additions and 0 deletions
|
|
@ -500,6 +500,10 @@ public:
|
||||||
* ------------------------------------------------------------------------ */
|
* ------------------------------------------------------------------------ */
|
||||||
|
|
||||||
virtual int globalvariableHandler(Node *n) {
|
virtual int globalvariableHandler(Node *n) {
|
||||||
|
// Don't export static globals, they won't be accessible when using a shared library, for example.
|
||||||
|
if (Checkattr(n, "storage", "static"))
|
||||||
|
return SWIG_NOWRAP;
|
||||||
|
|
||||||
// We can't export variables defined inside namespaces to C directly, whatever their type.
|
// We can't export variables defined inside namespaces to C directly, whatever their type.
|
||||||
String* const scope = Swig_scopename_prefix(Getattr(n, "name"));
|
String* const scope = Swig_scopename_prefix(Getattr(n, "name"));
|
||||||
if (!scope) {
|
if (!scope) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue