Skip to content

Commit 03e3807

Browse files
Move 'em undefs after #include <pyconfig.h> after all
1 parent 0f68815 commit 03e3807

3 files changed

Lines changed: 7 additions & 11 deletions

File tree

Modules/Setup

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ _symtable symtablemodule.c
348348
# Interface to the Expat XML parser
349349
# More information on Expat can be found at www.libexpat.org.
350350
#
351-
#pyexpat expat/xmlparse.c expat/xmlrole.c expat/xmltok.c pyexpat.c -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DXML_POOR_ENTROPY -UHAVE_ARC4RANDOM -UHAVE_ARC4RANDOM_BUF -UHAVE_GETENTROPY -UHAVE_GETRANDOM -UHAVE_SYSCALL_GETRANDOM -DUSE_PYEXPAT_CAPI
351+
#pyexpat expat/xmlparse.c expat/xmlrole.c expat/xmltok.c pyexpat.c -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DXML_POOR_ENTROPY -DUSE_PYEXPAT_CAPI
352352

353353
# Hye-Shik Chang's CJKCodecs
354354

Modules/expat/expat_config.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,10 @@
1919
#define XML_GE 1
2020
#define XML_CONTEXT_BYTES 1024
2121

22+
#undef HAVE_ARC4RANDOM
23+
#undef HAVE_ARC4RANDOM_BUF
24+
#undef HAVE_GETENTROPY
25+
#undef HAVE_GETRANDOM
26+
#undef HAVE_SYSCALL_GETRANDOM
27+
2228
#endif /* EXPAT_CONFIG_H */

setup.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1773,7 +1773,6 @@ def detect_expat_elementtree(self):
17731773
if '--with-system-expat' in sysconfig.get_config_var("CONFIG_ARGS"):
17741774
expat_inc = []
17751775
define_macros = []
1776-
undef_macros = []
17771776
extra_compile_args = []
17781777
expat_lib = ['expat']
17791778
expat_sources = []
@@ -1786,13 +1785,6 @@ def detect_expat_elementtree(self):
17861785
# call XML_SetHashSalt(), expat entropy sources are not needed
17871786
('XML_POOR_ENTROPY', '1'),
17881787
]
1789-
undef_macros = [
1790-
'HAVE_ARC4RANDOM',
1791-
'HAVE_ARC4RANDOM_BUF',
1792-
'HAVE_GETENTROPY',
1793-
'HAVE_GETRANDOM',
1794-
'HAVE_SYSCALL_GETRANDOM',
1795-
]
17961788
extra_compile_args = []
17971789
# bpo-44394: libexpat uses isnan() of math.h and needs linkage
17981790
# against the libm
@@ -1821,7 +1813,6 @@ def detect_expat_elementtree(self):
18211813

18221814
self.add(Extension('pyexpat',
18231815
define_macros=define_macros,
1824-
undef_macros=undef_macros,
18251816
extra_compile_args=extra_compile_args,
18261817
include_dirs=expat_inc,
18271818
libraries=expat_lib,
@@ -1835,7 +1826,6 @@ def detect_expat_elementtree(self):
18351826
define_macros.append(('USE_PYEXPAT_CAPI', None))
18361827
self.add(Extension('_elementtree',
18371828
define_macros=define_macros,
1838-
undef_macros=undef_macros,
18391829
include_dirs=expat_inc,
18401830
libraries=expat_lib,
18411831
sources=['_elementtree.c'],

0 commit comments

Comments
 (0)