mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +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
|
@ -26,6 +26,17 @@ includestuff = includestuff + """
|
|||
#include <Resources.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef USE_TOOLBOX_OBJECT_GLUE
|
||||
extern PyObject *_ResObj_New(Handle);
|
||||
extern int _ResObj_Convert(PyObject *, Handle *);
|
||||
extern PyObject *_OptResObj_New(Handle);
|
||||
extern int _OptResObj_Convert(PyObject *, Handle *);
|
||||
#define ResObj_New _ResObj_New
|
||||
#define ResObj_Convert _ResObj_Convert
|
||||
#define OptResObj_New _OptResObj_New
|
||||
#define OptResObj_Convert _OptResObj_Convert
|
||||
#endif
|
||||
|
||||
/* Function to dispose a resource, with a "normal" calling sequence */
|
||||
static void
|
||||
PyMac_AutoDisposeHandle(Handle h)
|
||||
|
@ -75,6 +86,10 @@ OptResObj_Convert(v, p_itself)
|
|||
"""
|
||||
|
||||
initstuff = initstuff + """
|
||||
PyMac_INIT_TOOLBOX_OBJECT_NEW(ResObj_New);
|
||||
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(ResObj_Convert);
|
||||
PyMac_INIT_TOOLBOX_OBJECT_NEW(OptResObj_New);
|
||||
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(OptResObj_Convert);
|
||||
"""
|
||||
|
||||
module = MacModule('Res', 'Res', includestuff, finalstuff, initstuff)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue