From 20bfe5fede4f936318bdf22f784381300e8b89d0 Mon Sep 17 00:00:00 2001 From: Marcelo Matus Date: Wed, 2 Nov 2005 12:50:52 +0000 Subject: [PATCH] add SWIG_STATIC_POINTER helper git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@7771 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- SWIG/Lib/swiglabels.swg | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/SWIG/Lib/swiglabels.swg b/SWIG/Lib/swiglabels.swg index aaeac5d5f..ff20b70e8 100644 --- a/SWIG/Lib/swiglabels.swg +++ b/SWIG/Lib/swiglabels.swg @@ -69,3 +69,17 @@ #endif +/* + Use this label for initialize a static pointer, as in + + int a; + int b; + static PyObject *MyVar = SWIG_SATIC_POINTER(MyVar) NewSomething(..); + ... + +*/ +#ifdef __cplusplus +#define SWIG_STATIC_POINTER(var) +#else +#define SWIG_STATIC_POINTER(var) 0; if (!var) var = +#endif