mirror of
https://github.com/python/cpython.git
synced 2025-11-26 13:22:51 +00:00
TickCount moved to a different header file. We manually added it back in here, for conveninece.
This commit is contained in:
parent
564980bd86
commit
ec982e2739
2 changed files with 24 additions and 0 deletions
|
|
@ -5,8 +5,12 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
#include "pywintoolbox.h"
|
||||||
|
#else
|
||||||
#include "macglue.h"
|
#include "macglue.h"
|
||||||
#include "pymactoolbox.h"
|
#include "pymactoolbox.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Macro to test whether a weak-loaded CFM function exists */
|
/* Macro to test whether a weak-loaded CFM function exists */
|
||||||
#define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\
|
#define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\
|
||||||
|
|
@ -455,6 +459,18 @@ static PyObject *Evt_LMSetKbdType(PyObject *_self, PyObject *_args)
|
||||||
return _res;
|
return _res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static PyObject *Evt_TickCount(PyObject *_self, PyObject *_args)
|
||||||
|
{
|
||||||
|
PyObject *_res = NULL;
|
||||||
|
UInt32 _rv;
|
||||||
|
if (!PyArg_ParseTuple(_args, ""))
|
||||||
|
return NULL;
|
||||||
|
_rv = TickCount();
|
||||||
|
_res = Py_BuildValue("l",
|
||||||
|
_rv);
|
||||||
|
return _res;
|
||||||
|
}
|
||||||
|
|
||||||
static PyObject *Evt_WaitNextEvent(PyObject *_self, PyObject *_args)
|
static PyObject *Evt_WaitNextEvent(PyObject *_self, PyObject *_args)
|
||||||
{
|
{
|
||||||
PyObject *_res = NULL;
|
PyObject *_res = NULL;
|
||||||
|
|
@ -566,6 +582,8 @@ static PyMethodDef Evt_methods[] = {
|
||||||
"() -> (UInt8 _rv)"},
|
"() -> (UInt8 _rv)"},
|
||||||
{"LMSetKbdType", (PyCFunction)Evt_LMSetKbdType, 1,
|
{"LMSetKbdType", (PyCFunction)Evt_LMSetKbdType, 1,
|
||||||
"(UInt8 value) -> None"},
|
"(UInt8 value) -> None"},
|
||||||
|
{"TickCount", (PyCFunction)Evt_TickCount, 1,
|
||||||
|
"() -> (UInt32 _rv)"},
|
||||||
{"WaitNextEvent", (PyCFunction)Evt_WaitNextEvent, 1,
|
{"WaitNextEvent", (PyCFunction)Evt_WaitNextEvent, 1,
|
||||||
"(EventMask eventMask, UInt32 sleep [,RegionHandle]) -> (Boolean _rv, EventRecord theEvent)"},
|
"(EventMask eventMask, UInt32 sleep [,RegionHandle]) -> (Boolean _rv, EventRecord theEvent)"},
|
||||||
{NULL, NULL, 0}
|
{NULL, NULL, 0}
|
||||||
|
|
|
||||||
|
|
@ -72,6 +72,11 @@ functions = []
|
||||||
##methods = []
|
##methods = []
|
||||||
execfile(INPUTFILE)
|
execfile(INPUTFILE)
|
||||||
|
|
||||||
|
# Move TickCount here, for convenience
|
||||||
|
f = Function(UInt32, 'TickCount',
|
||||||
|
)
|
||||||
|
functions.append(f)
|
||||||
|
|
||||||
# add the populated lists to the generator groups
|
# add the populated lists to the generator groups
|
||||||
# (in a different wordl the scan program would generate this)
|
# (in a different wordl the scan program would generate this)
|
||||||
for f in functions: module.add(f)
|
for f in functions: module.add(f)
|
||||||
|
|
@ -102,6 +107,7 @@ f = ManualGenerator("WaitNextEvent", WaitNextEvent_body);
|
||||||
f.docstring = lambda: "(EventMask eventMask, UInt32 sleep [,RegionHandle]) -> (Boolean _rv, EventRecord theEvent)"
|
f.docstring = lambda: "(EventMask eventMask, UInt32 sleep [,RegionHandle]) -> (Boolean _rv, EventRecord theEvent)"
|
||||||
module.add(f)
|
module.add(f)
|
||||||
|
|
||||||
|
|
||||||
# generate output (open the output file as late as possible)
|
# generate output (open the output file as late as possible)
|
||||||
SetOutputFileName(OUTPUTFILE)
|
SetOutputFileName(OUTPUTFILE)
|
||||||
module.generate()
|
module.generate()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue