[Python-checkins] cpython: use the '__linux__' instead 'linux' preprocessor define

benjamin.peterson python-checkins at python.org
Wed Sep 7 17:09:09 EDT 2016


https://hg.python.org/cpython/rev/577ef39f514b
changeset:   103246:577ef39f514b
user:        Benjamin Peterson <benjamin at python.org>
date:        Wed Sep 07 14:08:34 2016 -0700
summary:
  use the '__linux__' instead 'linux' preprocessor define

files:
  Modules/socketmodule.c |  8 ++++----
  1 files changed, 4 insertions(+), 4 deletions(-)


diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -153,7 +153,7 @@
    On the other hand, not all Linux versions agree, so there the settings
    computed by the configure script are needed! */
 
-#ifndef linux
+#ifndef __linux__
 # undef HAVE_GETHOSTBYNAME_R_3_ARG
 # undef HAVE_GETHOSTBYNAME_R_5_ARG
 # undef HAVE_GETHOSTBYNAME_R_6_ARG
@@ -176,7 +176,7 @@
 #  define HAVE_GETHOSTBYNAME_R_3_ARG
 # elif defined(__sun) || defined(__sgi)
 #  define HAVE_GETHOSTBYNAME_R_5_ARG
-# elif defined(linux)
+# elif defined(__linux__)
 /* Rely on the configure script */
 # else
 #  undef HAVE_GETHOSTBYNAME_R
@@ -1214,7 +1214,7 @@
     case AF_UNIX:
     {
         struct sockaddr_un *a = (struct sockaddr_un *) addr;
-#ifdef linux
+#ifdef __linux__
         if (a->sun_path[0] == 0) {  /* Linux abstract namespace */
             addrlen -= offsetof(struct sockaddr_un, sun_path);
             return PyBytes_FromStringAndSize(a->sun_path, addrlen);
@@ -1529,7 +1529,7 @@
         assert(path.len >= 0);
 
         addr = (struct sockaddr_un*)addr_ret;
-#ifdef linux
+#ifdef __linux__
         if (path.len > 0 && *(const char *)path.buf == 0) {
             /* Linux abstract namespace extension */
             if ((size_t)path.len > sizeof addr->sun_path) {

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list