[pypy-commit] pypy py3.5-mac-translate: Add check for HAVE_DIRENT_H
danchr
pypy.commits at gmail.com
Tue Apr 18 09:16:30 EDT 2017
Author: Dan Villiom Podlaski Christiansen <dan at magenta.dk>
Branch: py3.5-mac-translate
Changeset: r91080:b66e14493a7b
Date: 2017-04-18 12:57 +0200
http://bitbucket.org/pypy/pypy/changeset/b66e14493a7b/
Log: Add check for HAVE_DIRENT_H
_posixsubprocess.c uses this symbol to optionally include the
header, but there's no logic for actually defining it. As the 'DIR'
structure is defined in 'dirent.h' on macOS, C-source compilation
fails without it.
diff --git a/pypy/module/_posixsubprocess/interp_subprocess.py b/pypy/module/_posixsubprocess/interp_subprocess.py
--- a/pypy/module/_posixsubprocess/interp_subprocess.py
+++ b/pypy/module/_posixsubprocess/interp_subprocess.py
@@ -36,6 +36,15 @@
if config['HAVE_SETSID']:
compile_extra.append("-DHAVE_SETSID")
+class CConfig:
+ _compilation_info_ = ExternalCompilationInfo(includes=['dirent.h'])
+ HAVE_DIRENT_H = platform.Has("opendir")
+
+config = platform.configure(CConfig)
+
+if config['HAVE_DIRENT_H']:
+ compile_extra.append("-DHAVE_DIRENT_H")
+
eci = eci.merge(
rposix.eci_inheritable,
ExternalCompilationInfo(
More information about the pypy-commit
mailing list