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:
Vadim Zeitlin 2016-04-22 01:46:44 +02:00
commit 5fd1f28477

View file

@ -500,6 +500,10 @@ public:
* ------------------------------------------------------------------------ */
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.
String* const scope = Swig_scopename_prefix(Getattr(n, "name"));
if (!scope) {