Commits

Amaury Forgeot d'Arc committed dc601bc

Configure wait macros individually

Comments (0)

Files changed (2)

pypy/module/posix/__init__.py

         interpleveldefs['pathconf_names'] = 'space.wrap(os.pathconf_names)'
 
     # Macros for process exit statuses: WIFEXITED &co
-    if rposix.HAVE_WAIT:
-        for name in rposix.wait_macros:
+    for name in rposix.wait_macros:
+        if getattr(rposix, 'HAVE_' + name):
             interpleveldefs[name] = 'interp_posix.' + name
 
     def __init__(self, space, w_name):

rpython/rlib/rposix.py

         '''.split():
     setattr(CConfig, name, rffi_platform.DefinedConstantInteger(name))
 
+wait_macros_returning_int = ['WEXITSTATUS', 'WSTOPSIG', 'WTERMSIG']
+wait_macros_returning_bool = ['WCOREDUMP', 'WIFCONTINUED', 'WIFSTOPPED',
+                              'WIFSIGNALED', 'WIFEXITED']
+wait_macros = wait_macros_returning_int + wait_macros_returning_bool
+for name in wait_macros:
+    setattr(CConfig, 'HAVE_' + name, rffi_platform.Defined(name))
+
 globals().update(rffi_platform.configure(CConfig))
 
 
 c_fchmod = external('fchmod', [rffi.INT, rffi.MODE_T], rffi.INT)
 c_fchown = external('fchown', [rffi.INT, rffi.INT, rffi.INT], rffi.INT)
 
-if HAVE_WAIT:
-    wait_macros_returning_int = ['WEXITSTATUS', 'WSTOPSIG', 'WTERMSIG']
-    wait_macros_returning_bool = ['WCOREDUMP', 'WIFCONTINUED', 'WIFSTOPPED',
-                                 'WIFSIGNALED', 'WIFEXITED']
-    wait_macros = wait_macros_returning_int + wait_macros_returning_bool
-    for name in wait_macros:
-        globals()[name] = external(name, [lltype.Signed], lltype.Signed,
-                                   macro=True)
+for name in wait_macros:
+    globals()[name] = external(name, [lltype.Signed], lltype.Signed,
+                               macro=True)
 
 
 #___________________________________________________________________