From 07c115102a805c13dbd79e04dc175260afff8392 Mon Sep 17 00:00:00 2001 From: Marcelo Matus Date: Tue, 6 Dec 2005 20:14:55 +0000 Subject: [PATCH] more portability tricks git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7934 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- CHANGES.current | 8 ++++++++ Lib/python/pyinit.swg | 9 ++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/CHANGES.current b/CHANGES.current index d511498b6..973e8ebd9 100644 --- a/CHANGES.current +++ b/CHANGES.current @@ -13,6 +13,14 @@ Version 1.3.28 (unreleased). 12/06/2005: mmatus + [Python] The generated code is now more portable, specially + for Windows. Following + + http://www.python.org/doc/faq/windows.html + + Py_None is never accessed as a structure, plus other + tricks mentioned there. + [Python] Added initial support for threads based in the proposal by Joseph Winston. diff --git a/Lib/python/pyinit.swg b/Lib/python/pyinit.swg index 09892dc3b..c3b9ff411 100644 --- a/Lib/python/pyinit.swg +++ b/Lib/python/pyinit.swg @@ -96,13 +96,10 @@ swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) { SWIGINTERN PyTypeObject* swig_varlink_type(void) { static char varlink__doc__[] = "Swig var link object"; - static PyTypeObject varlink_type -#if !defined(__cplusplus) - ; + static PyTypeObject varlink_type; static int type_init = 0; if (!type_init) { const PyTypeObject tmp -#endif = { PyObject_HEAD_INIT(NULL) 0, /* Number of items in variable part (ob_size) */ @@ -140,12 +137,10 @@ swig_varlink_type(void) { 0,0,0,0 /* tp_alloc -> tp_next */ #endif }; -#if !defined(__cplusplus) varlink_type = tmp; + varlink_type.ob_type = &PyType_Type; type_init = 1; } -#endif - varlink_type.ob_type = &PyType_Type; return &varlink_type; }