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
|
@ -37,6 +37,15 @@ CGrafPtr = OpaqueByValueType("CGrafPtr", "GrafObj")
|
|||
includestuff = includestuff + """
|
||||
#include <%s>""" % MACHEADERFILE + """
|
||||
|
||||
|
||||
#ifdef USE_TOOLBOX_OBJECT_GLUE
|
||||
extern PyObject *_ListObj_New(ListHandle);
|
||||
extern int _ListObj_Convert(PyObject *, ListHandle *);
|
||||
|
||||
#define ListObj_New _ListObj_New
|
||||
#define ListObj_Convert _ListObj_Convert
|
||||
#endif
|
||||
|
||||
#if !ACCESSOR_CALLS_ARE_FUNCTIONS
|
||||
#define GetListPort(list) ((CGrafPtr)(*(list))->port)
|
||||
#define GetListVerticalScrollBar(list) ((*(list))->vScroll)
|
||||
|
@ -66,6 +75,11 @@ includestuff = includestuff + """
|
|||
#define as_Resource(lh) ((Handle)lh)
|
||||
"""
|
||||
|
||||
initstuff = initstuff + """
|
||||
PyMac_INIT_TOOLBOX_OBJECT_NEW(ListObj_New);
|
||||
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(ListObj_Convert);
|
||||
"""
|
||||
|
||||
class ListMethodGenerator(MethodGenerator):
|
||||
"""Similar to MethodGenerator, but has self as last argument"""
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue