#ifndef __WXHACK_H #define __WXHACK_H #define wxPyUSE_EXPORTED_API #include "wxPython_int.h" static bool wxPyCoreAPI_IMPORT() { wxPyCoreAPIPtr = (wxPyCoreAPI*)PyCObject_Import("wx._core_", "_wxPyCoreAPI"); return wxPyCoreAPIPtr != NULL; } // Used by the macros below to fetch the API pointer, importing it first if // needed. This should never need to be called directly. inline wxPyCoreAPI* wxPyGetCoreAPIPtr() { if (wxPyCoreAPIPtr == NULL) wxPyCoreAPI_IMPORT(); // wxASSERT_MSW(wxPyCoreAPIPtr != NULL, wxT("wxPyCoreAPIPtr is NULL!!!")); // uncomment when needed for debugging return wxPyCoreAPIPtr; } #define wxPyConvertSwigPtr(a,b,c) (wxPyGetCoreAPIPtr()->p_wxPyConvertSwigPtr(a,b,c)) #endif