[Python-checkins] r84348 - in python/branches/release31-maint: Include/longobject.h Misc/NEWS Modules/socketmodule.h

antoine.pitrou python-checkins at python.org
Sat Aug 28 22:53:24 CEST 2010


Author: antoine.pitrou
Date: Sat Aug 28 22:53:24 2010
New Revision: 84348

Log:
Merged revisions 84347 via svnmerge from 
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r84347 | antoine.pitrou | 2010-08-28 22:42:55 +0200 (sam., 28 août 2010) | 5 lines
  
  Issue #4835: make PyLong_FromSocket_t() and PyLong_AsSocket_t() private
  to the socket module, and fix the width of socket descriptors to be
  correctly detected under 64-bit Windows.
........


Modified:
   python/branches/release31-maint/   (props changed)
   python/branches/release31-maint/Include/longobject.h
   python/branches/release31-maint/Misc/NEWS
   python/branches/release31-maint/Modules/socketmodule.h

Modified: python/branches/release31-maint/Include/longobject.h
==============================================================================
--- python/branches/release31-maint/Include/longobject.h	(original)
+++ python/branches/release31-maint/Include/longobject.h	Sat Aug 28 22:53:24 2010
@@ -32,15 +32,6 @@
    cleanup to keep the extra information. [CH] */
 #define PyLong_AS_LONG(op) PyLong_AsLong(op)
 
-/* Used by socketmodule.c */
-#if SIZEOF_SOCKET_T <= SIZEOF_LONG
-#define PyLong_FromSocket_t(fd) PyLong_FromLong((SOCKET_T)(fd))
-#define PyLong_AsSocket_t(fd) (SOCKET_T)PyLong_AsLong(fd)
-#else
-#define PyLong_FromSocket_t(fd) PyLong_FromLongLong(((SOCKET_T)(fd));
-#define PyLong_AsSocket_t(fd) (SOCKET_T)PyLong_AsLongLong(fd)
-#endif
-
 /* For use by intobject.c only */
 PyAPI_DATA(unsigned char) _PyLong_DigitValue[256];
 

Modified: python/branches/release31-maint/Misc/NEWS
==============================================================================
--- python/branches/release31-maint/Misc/NEWS	(original)
+++ python/branches/release31-maint/Misc/NEWS	Sat Aug 28 22:53:24 2010
@@ -463,6 +463,10 @@
 Extension Modules
 -----------------
 
+- Issue #4835: make PyLong_FromSocket_t() and PyLong_AsSocket_t() private
+  to the socket module, and fix the width of socket descriptors to be
+  correctly detected under 64-bit Windows.
+
 - Issue #665761: ``functools.reduce()`` will no longer mask exceptions
   other than ``TypeError`` raised by the iterator argument.
 

Modified: python/branches/release31-maint/Modules/socketmodule.h
==============================================================================
--- python/branches/release31-maint/Modules/socketmodule.h	(original)
+++ python/branches/release31-maint/Modules/socketmodule.h	Sat Aug 28 22:53:24 2010
@@ -93,6 +93,14 @@
 #       define SIZEOF_SOCKET_T SIZEOF_INT
 #endif
 
+#if SIZEOF_SOCKET_T <= SIZEOF_LONG
+#define PyLong_FromSocket_t(fd) PyLong_FromLong((SOCKET_T)(fd))
+#define PyLong_AsSocket_t(fd) (SOCKET_T)PyLong_AsLong(fd)
+#else
+#define PyLong_FromSocket_t(fd) PyLong_FromLongLong((SOCKET_T)(fd))
+#define PyLong_AsSocket_t(fd) (SOCKET_T)PyLong_AsLongLong(fd)
+#endif
+
 /* Socket address */
 typedef union sock_addr {
     struct sockaddr_in in;


More information about the Python-checkins mailing list