]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-45743: Move __APPLE_USE_RFC_3542 into socketmodule.c (GH-29456)
authorChristian Heimes <christian@python.org>
Mon, 8 Nov 2021 11:48:34 +0000 (13:48 +0200)
committerGitHub <noreply@github.com>
Mon, 8 Nov 2021 11:48:34 +0000 (12:48 +0100)
Modules/socketmodule.c
setup.py

index 50962c41cd3a68d14711ff5afc52237f92018f40..ed1043c0c43a507f2d3aa2f80f51ca7a60344197 100644 (file)
@@ -86,6 +86,8 @@ Local naming conventions:
 */
 
 #ifdef __APPLE__
+// Issue #35569: Expose RFC 3542 socket options.
+#define __APPLE_USE_RFC_3542 1
 #include <AvailabilityMacros.h>
 /* for getaddrinfo thread safety test on old versions of OS X */
 #ifndef MAC_OS_X_VERSION_10_5
index b6bf8e129373b45eb6214847ca9679bc9662ff71..fb641bd57d0d63bffedcaf42876f7b469c84229e 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -1222,13 +1222,7 @@ class PyBuildExt(build_ext):
         self.add(Extension('_crypt', ['_cryptmodule.c'], libraries=libs))
 
     def detect_socket(self):
-        # socket(2)
-        kwargs = {'depends': ['socketmodule.h']}
-        if MACOS:
-            # Issue #35569: Expose RFC 3542 socket options.
-            kwargs['extra_compile_args'] = ['-D__APPLE_USE_RFC_3542']
-
-        self.add(Extension('_socket', ['socketmodule.c'], **kwargs))
+        self.add(Extension('_socket', ['socketmodule.c'], depends=['socketmodule.h']))
 
     def detect_dbm_gdbm(self):
         # Modules that provide persistent dictionary-like semantics.  You will