]> git.proxmox.com Git - mirror_edk2.git/blobdiff - AppPkg/Applications/Python/Python-2.7.10/PyMod-2.7.10/Modules/selectmodule.c
AppPkg/.../Python-2.7.10: AppPkg.dsc, pyconfig.h, PyMod-2.7.10
[mirror_edk2.git] / AppPkg / Applications / Python / Python-2.7.10 / PyMod-2.7.10 / Modules / selectmodule.c
index 29e9d976710aa344f10812874ff1087b9ace9fa2..a62774a462b919d696d93f18d66ddc35e8d5dafe 100644 (file)
@@ -1,9 +1,20 @@
-/* select - Module containing unix select(2) call.\r
-   Under Unix, the file descriptors are small integers.\r
-   Under Win32, select only exists for sockets, and sockets may\r
-   have any value except INVALID_SOCKET.\r
-   Under BeOS, we suffer the same dichotomy as Win32; sockets can be anything\r
-   >= 0.\r
+/*  @file\r
+  select - Module containing unix select(2) call.\r
+  Under Unix, the file descriptors are small integers.\r
+  Under Win32, select only exists for sockets, and sockets may\r
+  have any value except INVALID_SOCKET.\r
+  Under BeOS, we suffer the same dichotomy as Win32; sockets can be anything\r
+  >= 0.\r
+\r
+  Copyright (c) 2015, Daryl McDaniel. All rights reserved.<BR>\r
+  Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.<BR>\r
+  This program and the accompanying materials are licensed and made available under\r
+  the terms and conditions of the BSD License that accompanies this distribution.\r
+  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 */\r
 \r
 #include "Python.h"\r
@@ -107,7 +118,7 @@ seq2set(PyObject *seq, fd_set *set, pylist fd2obj[FD_SETSIZE + 1])
         v = PyObject_AsFileDescriptor( o );\r
         if (v == -1) goto finally;\r
 \r
-#if defined(_MSC_VER)\r
+#if defined(_MSC_VER) && !defined(UEFI_C_SOURCE)\r
         max = 0;                             /* not used for Win32 */\r
 #else  /* !_MSC_VER */\r
         if (!_PyIsSelectable_fd(v)) {\r
@@ -1236,17 +1247,17 @@ static PyTypeObject kqueue_queue_Type;
  * kevent is not standard and its members vary across BSDs.\r
  */\r
 #if !defined(__OpenBSD__)\r
-#   define IDENT_TYPE  T_UINTPTRT\r
-#   define IDENT_CAST  Py_intptr_t\r
-#   define DATA_TYPE   T_INTPTRT\r
+#   define IDENT_TYPE T_UINTPTRT\r
+#   define IDENT_CAST Py_intptr_t\r
+#   define DATA_TYPE  T_INTPTRT\r
 #   define DATA_FMT_UNIT INTPTRT_FMT_UNIT\r
-#   define IDENT_AsType        PyLong_AsUintptr_t\r
+#   define IDENT_AsType PyLong_AsUintptr_t\r
 #else\r
-#   define IDENT_TYPE  T_UINT\r
-#   define IDENT_CAST  int\r
-#   define DATA_TYPE   T_INT\r
+#   define IDENT_TYPE T_UINT\r
+#   define IDENT_CAST int\r
+#   define DATA_TYPE  T_INT\r
 #   define DATA_FMT_UNIT "i"\r
-#   define IDENT_AsType        PyLong_AsUnsignedLong\r
+#   define IDENT_AsType PyLong_AsUnsignedLong\r
 #endif\r
 \r
 /* Unfortunately, we can't store python objects in udata, because\r
@@ -1298,7 +1309,7 @@ kqueue_event_init(kqueue_event_Object *self, PyObject *args, PyObject *kwds)
 \r
     if (PyLong_Check(pfd)\r
 #if IDENT_TYPE == T_UINT\r
-       && PyLong_AsUnsignedLong(pfd) <= UINT_MAX\r
+  && PyLong_AsUnsignedLong(pfd) <= UINT_MAX\r
 #endif\r
     ) {\r
         self->e.ident = IDENT_AsType(pfd);\r