mirror of https://github.com/python/cpython.git
Ifdeffed a few more sections. All functionality that is relevant on MacOSX
now appears to work.
This commit is contained in:
parent
6143d533b6
commit
f3163303a9
|
@ -400,6 +400,8 @@ MacOS_AcceptHighLevelEvent(self, args)
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if !TARGET_API_MAC_OSX
|
||||||
static char schedparams_doc[] = "Set/return mainloop interrupt check flag, etc";
|
static char schedparams_doc[] = "Set/return mainloop interrupt check flag, etc";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -488,6 +490,7 @@ MacOS_HandleEvent(PyObject *self, PyObject *args)
|
||||||
Py_INCREF(Py_None);
|
Py_INCREF(Py_None);
|
||||||
return Py_None;
|
return Py_None;
|
||||||
}
|
}
|
||||||
|
#endif /* !TARGET_API_MAC_OSX */
|
||||||
|
|
||||||
static char geterr_doc[] = "Convert OSErr number to string";
|
static char geterr_doc[] = "Convert OSErr number to string";
|
||||||
|
|
||||||
|
@ -641,6 +644,7 @@ MacOS_openrf(PyObject *self, PyObject *args)
|
||||||
return (PyObject *)fp;
|
return (PyObject *)fp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !TARGET_API_MAC_OSX
|
||||||
static char FreeMem_doc[] = "Return the total amount of free space in the heap";
|
static char FreeMem_doc[] = "Return the total amount of free space in the heap";
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
|
@ -706,6 +710,7 @@ MacOS_OutputSeen(PyObject *self, PyObject *args)
|
||||||
Py_INCREF(Py_None);
|
Py_INCREF(Py_None);
|
||||||
return Py_None;
|
return Py_None;
|
||||||
}
|
}
|
||||||
|
#endif /* !TARGET_API_MAC_OSX */
|
||||||
|
|
||||||
static PyMethodDef MacOS_Methods[] = {
|
static PyMethodDef MacOS_Methods[] = {
|
||||||
#if TARGET_API_MAC_OS8
|
#if TARGET_API_MAC_OS8
|
||||||
|
@ -713,21 +718,25 @@ static PyMethodDef MacOS_Methods[] = {
|
||||||
#endif
|
#endif
|
||||||
{"GetCreatorAndType", MacOS_GetCreatorAndType, 1, getcrtp_doc},
|
{"GetCreatorAndType", MacOS_GetCreatorAndType, 1, getcrtp_doc},
|
||||||
{"SetCreatorAndType", MacOS_SetCreatorAndType, 1, setcrtp_doc},
|
{"SetCreatorAndType", MacOS_SetCreatorAndType, 1, setcrtp_doc},
|
||||||
|
#if !TARGET_API_MAC_OSX
|
||||||
{"SchedParams", MacOS_SchedParams, 1, schedparams_doc},
|
{"SchedParams", MacOS_SchedParams, 1, schedparams_doc},
|
||||||
{"EnableAppswitch", MacOS_EnableAppswitch, 1, appswitch_doc},
|
{"EnableAppswitch", MacOS_EnableAppswitch, 1, appswitch_doc},
|
||||||
{"SetEventHandler", MacOS_SetEventHandler, 1, setevh_doc},
|
{"SetEventHandler", MacOS_SetEventHandler, 1, setevh_doc},
|
||||||
{"HandleEvent", MacOS_HandleEvent, 1, handleev_doc},
|
{"HandleEvent", MacOS_HandleEvent, 1, handleev_doc},
|
||||||
|
#endif
|
||||||
{"GetErrorString", MacOS_GetErrorString, 1, geterr_doc},
|
{"GetErrorString", MacOS_GetErrorString, 1, geterr_doc},
|
||||||
{"openrf", MacOS_openrf, 1, openrf_doc},
|
{"openrf", MacOS_openrf, 1, openrf_doc},
|
||||||
{"splash", MacOS_splash, 1, splash_doc},
|
{"splash", MacOS_splash, 1, splash_doc},
|
||||||
{"DebugStr", MacOS_DebugStr, 1, DebugStr_doc},
|
{"DebugStr", MacOS_DebugStr, 1, DebugStr_doc},
|
||||||
{"GetTicks", MacOS_GetTicks, 1, GetTicks_doc},
|
{"GetTicks", MacOS_GetTicks, 1, GetTicks_doc},
|
||||||
{"SysBeep", MacOS_SysBeep, 1, SysBeep_doc},
|
{"SysBeep", MacOS_SysBeep, 1, SysBeep_doc},
|
||||||
|
#if !TARGET_API_MAC_OSX
|
||||||
{"FreeMem", MacOS_FreeMem, 1, FreeMem_doc},
|
{"FreeMem", MacOS_FreeMem, 1, FreeMem_doc},
|
||||||
{"MaxBlock", MacOS_MaxBlock, 1, MaxBlock_doc},
|
{"MaxBlock", MacOS_MaxBlock, 1, MaxBlock_doc},
|
||||||
{"CompactMem", MacOS_CompactMem, 1, CompactMem_doc},
|
{"CompactMem", MacOS_CompactMem, 1, CompactMem_doc},
|
||||||
{"KeepConsole", MacOS_KeepConsole, 1, KeepConsole_doc},
|
{"KeepConsole", MacOS_KeepConsole, 1, KeepConsole_doc},
|
||||||
{"OutputSeen", MacOS_OutputSeen, 1, OutputSeen_doc},
|
{"OutputSeen", MacOS_OutputSeen, 1, OutputSeen_doc},
|
||||||
|
#endif
|
||||||
{NULL, NULL} /* Sentinel */
|
{NULL, NULL} /* Sentinel */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -763,12 +772,12 @@ initMacOS()
|
||||||
if (PyDict_SetItemString(d, "AppearanceCompliant",
|
if (PyDict_SetItemString(d, "AppearanceCompliant",
|
||||||
Py_BuildValue("i", PyMac_AppearanceCompliant)) != 0)
|
Py_BuildValue("i", PyMac_AppearanceCompliant)) != 0)
|
||||||
return;
|
return;
|
||||||
#if TARGET_API_MAC_CARBON
|
#if TARGET_API_MAC_OSX
|
||||||
#define PY_RUNTIMEMODEL "carbon"
|
#define PY_RUNTIMEMODEL "macho"
|
||||||
#elif TARGET_API_MAC_OS8
|
#elif TARGET_API_MAC_OS8
|
||||||
#define PY_RUNTIMEMODEL "ppc"
|
#define PY_RUNTIMEMODEL "ppc"
|
||||||
#elif TARGET_API_MAC_OSX
|
#elif TARGET_API_MAC_CARBON
|
||||||
#define PY_RUNTIMEMODEL "macho"
|
#define PY_RUNTIMEMODEL "carbon"
|
||||||
#else
|
#else
|
||||||
#error "None of the TARGET_API_MAC_XXX I know about is set"
|
#error "None of the TARGET_API_MAC_XXX I know about is set"
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue