diff options
Diffstat (limited to 'Mac/Modules/win')
-rw-r--r-- | Mac/Modules/win/Winmodule.c | 11 | ||||
-rw-r--r-- | Mac/Modules/win/winsupport.py | 2 |
2 files changed, 7 insertions, 6 deletions
diff --git a/Mac/Modules/win/Winmodule.c b/Mac/Modules/win/Winmodule.c index 3f60d37..181cf77 100644 --- a/Mac/Modules/win/Winmodule.c +++ b/Mac/Modules/win/Winmodule.c @@ -36,12 +36,10 @@ extern PyObject *WinObj_WhichWindow(WindowPtr); #define resNotFound -192 /* Can't include <Errors.h> because of Python's "errors.h" */ -#ifdef __MWERKS__ +#ifdef HAVE_UNIVERSAL_HEADERS #define WindowPeek WindowPtr #endif -extern PyObject *WinObj_WhichWindow(WindowPtr w); /* Forward */ - static PyObject *Win_Error; /* ----------------------- Object type Window ----------------------- */ @@ -56,7 +54,7 @@ typedef struct WindowObject { } WindowObject; PyObject *WinObj_New(itself) - const WindowPtr itself; + WindowPtr itself; { WindowObject *it; if (itself == NULL) return PyMac_Error(resNotFound); @@ -844,7 +842,10 @@ WinObj_WhichWindow(w) /* XXX What if we find a stdwin window or a window belonging to some other package? */ - it = (PyObject *) GetWRefCon(w); + if (w == NULL) + it = NULL; + else + it = (PyObject *) GetWRefCon(w); if (it == NULL || ((WindowObject *)it)->ob_itself != w) it = Py_None; Py_INCREF(it); diff --git a/Mac/Modules/win/winsupport.py b/Mac/Modules/win/winsupport.py index c1057e2..a7f1ebd 100644 --- a/Mac/Modules/win/winsupport.py +++ b/Mac/Modules/win/winsupport.py @@ -32,7 +32,7 @@ includestuff = includestuff + """ #define resNotFound -192 /* Can't include <Errors.h> because of Python's "errors.h" */ -#ifdef __MWERKS__ +#ifdef HAVE_UNIVERSAL_HEADERS #define WindowPeek WindowPtr #endif """ |