diff options
author | Guido van Rossum <guido@python.org> | 1995-02-19 15:59:49 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1995-02-19 15:59:49 (GMT) |
commit | 9784295b157ac9db30d52708f67d115c397290ab (patch) | |
tree | 066d7b16e5515db0de5e13efdde2709d1463140b /Mac/Modules/win | |
parent | 295d171650758106cd4c24410f5a5c0740b914b2 (diff) | |
download | cpython-9784295b157ac9db30d52708f67d115c397290ab.zip cpython-9784295b157ac9db30d52708f67d115c397290ab.tar.gz cpython-9784295b157ac9db30d52708f67d115c397290ab.tar.bz2 |
another round... ported to __SC__
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 """ |