From: Berker Peksag Date: Mon, 8 Aug 2016 11:07:05 +0000 (+0300) Subject: Issue #27702: Only expose SOCK_RAW when defined X-Git-Tag: v3.6.0a4~51 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=95e0df8389c8a44c0f6c6b6be8363e602e8e8914;p=thirdparty%2FPython%2Fcpython.git Issue #27702: Only expose SOCK_RAW when defined SOCK_RAW is marked as optional in the POSIX specification: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_socket.h.html Patch by Ed Schouten. --- diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index d21d18f7e3de..d21509e9ebe5 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -6495,7 +6495,10 @@ PyInit__socket(void) PyModule_AddIntMacro(m, SOCK_STREAM); PyModule_AddIntMacro(m, SOCK_DGRAM); /* We have incomplete socket support. */ +#ifdef SOCK_RAW + /* SOCK_RAW is marked as optional in the POSIX specification */ PyModule_AddIntMacro(m, SOCK_RAW); +#endif PyModule_AddIntMacro(m, SOCK_SEQPACKET); #if defined(SOCK_RDM) PyModule_AddIntMacro(m, SOCK_RDM);