mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
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.
This commit is contained in:
parent
99f9baa331
commit
0e04eecdbf
26 changed files with 463 additions and 2 deletions
|
@ -10,6 +10,14 @@
|
|||
|
||||
#include <QDOffscreen.h>
|
||||
|
||||
#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))
|
||||
|
||||
|
||||
|
@ -622,6 +630,9 @@ void initQdoffs()
|
|||
|
||||
|
||||
|
||||
PyMac_INIT_TOOLBOX_OBJECT_NEW(GWorldObj_New);
|
||||
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(GWorldObj_Convert);
|
||||
|
||||
|
||||
m = Py_InitModule("Qdoffs", Qdoffs_methods);
|
||||
d = PyModule_GetDict(m);
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue