Commit 3b193447 authored by Denis Bilenko's avatar Denis Bilenko

use 'm4 -P' to avoid clashing of Python's len with m4's len

parent d85f6df8
......@@ -391,12 +391,12 @@ cdef public class loop [object PyGeventLoopObject, type PyGeventLoop_Type]:
return result
define(INCREF, ``if self._incref == 0:
m4_define(INCREF, ``if self._incref == 0:
self._incref = 1
Py_INCREF(<PyObjectPtr>self)'')
define(WATCHER_BASE, `cdef public loop loop
m4_define(WATCHER_BASE, `cdef public loop loop
cdef object _callback
cdef public tuple args
cdef readonly int _incref # 1 - increfed, 0 - not increfed
......@@ -445,27 +445,27 @@ define(WATCHER_BASE, `cdef public loop loop
INCREF')
define(ACTIVE, `property active:
m4_define(ACTIVE, `property active:
def __get__(self):
return True if libev.ev_is_active(&self._watcher) else False')
define(START, `def start(self, object callback, *args):
m4_define(START, `def start(self, object callback, *args):
self.callback = callback
self.args = args
libev.ev_$1_start(self.loop._ptr, &self._watcher)
INCREF')
define(WATCHER, `WATCHER_BASE($1)
m4_define(WATCHER, `WATCHER_BASE($1)
START($1)
ACTIVE($1)')
define(INIT, `def __init__(self, loop loop$2):
m4_define(INIT, `def __init__(self, loop loop$2):
libev.ev_$1_init(&self._watcher, <void *>gevent_callback_$1$3)
self.loop = loop
self._incref = 0')
......
......@@ -139,7 +139,7 @@ def replace_in_file(filename, old, new, check=True):
def run_cython_core(cython_command):
if need_update('gevent/core.pyx', 'gevent/core_.pyx'):
system('m4 gevent/core_.pyx > core.pyx && mv core.pyx gevent/')
system('m4 -P gevent/core_.pyx > core.pyx && mv core.pyx gevent/')
if need_update('gevent/gevent.core.c', 'gevent/core.p*x*', 'gevent/libev.pxd'):
if 0 == system('%s gevent/core.pyx -o gevent.core.c && mv gevent.core.* gevent/' % (cython_command, )):
replace_in_file('gevent/gevent.core.c', '\n\n#endif /* Py_PYTHON_H */', '\n#include "callbacks.c"\n#endif /* Py_PYTHON_H */')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment