diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 2001-05-17 21:58:34 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 2001-05-17 21:58:34 (GMT) |
commit | 0e04eecdbf8467cf3fe055e41e96fa48507b998c (patch) | |
tree | 0c3373b79a29ab55b8c542fd06ddbc9d78dd9d39 /Mac/Modules/qdoffs/qdoffssupport.py | |
parent | 99f9baa33190482784900970fd3e1c76e7cb48d6 (diff) | |
download | cpython-0e04eecdbf8467cf3fe055e41e96fa48507b998c.zip cpython-0e04eecdbf8467cf3fe055e41e96fa48507b998c.tar.gz cpython-0e04eecdbf8467cf3fe055e41e96fa48507b998c.tar.bz2 |
First step in porting MacPython modules to OSX/unix: break all references between modules except for the obj_New() and obj_Convert() routines, the PyArg_Parse and Py_BuildValue helpers.
And these can now be vectored through glue routines (by defining USE_TOOLBOX_OBJECT_GLUE) which will do the necessary imports, whereupon the module's init routine will tell the glue routine about the real conversion routine address and everything is fine again.
Diffstat (limited to 'Mac/Modules/qdoffs/qdoffssupport.py')
-rw-r--r-- | Mac/Modules/qdoffs/qdoffssupport.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Mac/Modules/qdoffs/qdoffssupport.py b/Mac/Modules/qdoffs/qdoffssupport.py index 7f4a043..3d96ca4 100644 --- a/Mac/Modules/qdoffs/qdoffssupport.py +++ b/Mac/Modules/qdoffs/qdoffssupport.py @@ -36,10 +36,22 @@ QDErr = OSErrType("QDErr", 'h') includestuff = includestuff + """ #include <%s>""" % MACHEADERFILE + """ +#ifdef USE_TOOLBOX_OBJECT_GLUE +extern PyObject *_GWorldObj_New(GWorldPtr); +extern int _GWorldObj_Convert(PyObject *, GWorldPtr *); + +#define GWorldObj_New _GWorldObj_New +#define GWorldObj_Convert _GWorldObj_Convert +#endif + #define as_GrafPtr(gworld) ((GrafPtr)(gworld)) """ +initstuff = initstuff + """ + PyMac_INIT_TOOLBOX_OBJECT_NEW(GWorldObj_New); + PyMac_INIT_TOOLBOX_OBJECT_CONVERT(GWorldObj_Convert); +""" class MyObjectDefinition(GlobalObjectDefinition): def outputCheckNewArg(self): |