mirror of
https://github.com/python/cpython.git
synced 2025-07-29 06:05:00 +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
|
@ -39,6 +39,15 @@ includestuff = includestuff + """
|
|||
#include <Devices.h> /* Defines OpenDeskAcc in universal headers */
|
||||
#include <%s>""" % MACHEADERFILE + """
|
||||
|
||||
#ifdef USE_TOOLBOX_OBJECT_GLUE
|
||||
|
||||
extern PyObject *_MenuObj_New(MenuHandle);
|
||||
extern int _MenuObj_Convert(PyObject *, MenuHandle *);
|
||||
|
||||
#define MenuObj_New _MenuObj_New
|
||||
#define MenuObj_Convert _MenuObj_Convert
|
||||
#endif
|
||||
|
||||
#if !ACCESSOR_CALLS_ARE_FUNCTIONS
|
||||
#define GetMenuID(menu) ((*(menu))->menuID)
|
||||
#define GetMenuWidth(menu) ((*(menu))->menuWidth)
|
||||
|
@ -53,6 +62,11 @@ includestuff = includestuff + """
|
|||
#define as_Resource(h) ((Handle)h)
|
||||
"""
|
||||
|
||||
initstuff = initstuff + """
|
||||
PyMac_INIT_TOOLBOX_OBJECT_NEW(MenuObj_New);
|
||||
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(MenuObj_Convert);
|
||||
"""
|
||||
|
||||
class MyObjectDefinition(GlobalObjectDefinition):
|
||||
pass
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue