]> granicus.if.org Git - python/commitdiff
Close #17931: Fix PyLong_FromPid() on Windows 64-bit: processes are identified
authorVictor Stinner <victor.stinner@gmail.com>
Tue, 4 Jun 2013 21:56:38 +0000 (23:56 +0200)
committerVictor Stinner <victor.stinner@gmail.com>
Tue, 4 Jun 2013 21:56:38 +0000 (23:56 +0200)
by their HANDLE which is a pointer (and not a long, which is smaller).

Include/pyport.h
Misc/NEWS
PC/pyconfig.h

index 96e8f1a5f86d82c35ae58df046b2735fe6ef1eb4..eb1bbe20ec60db34d9eb785d610a0f664af69cf4 100644 (file)
@@ -219,10 +219,6 @@ typedef size_t Py_uhash_t;
 /* Smallest negative value of type Py_ssize_t. */
 #define PY_SSIZE_T_MIN (-PY_SSIZE_T_MAX-1)
 
-#if SIZEOF_PID_T > SIZEOF_LONG
-#   error "Python doesn't support sizeof(pid_t) > sizeof(long)"
-#endif
-
 /* PY_FORMAT_SIZE_T is a platform-specific modifier for use in a printf
  * format to convert an argument with the width of a size_t or Py_ssize_t.
  * C99 introduced "z" for this purpose, but not all platforms support that;
index ce7a2485fbabdff20eb9dc354f5edc7164056c82..a7e76f4b7a50d05ba59ff5083672c6eb491dab8c 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -10,6 +10,10 @@ What's New in Python 3.4.0 Alpha 1?
 Core and Builtins
 -----------------
 
+- Issue #17931: Fix PyLong_FromPid() on Windows 64-bit: processes are
+  identified by their HANDLE which is a pointer (and not a long, which is
+  smaller).
+
 - Tweak the exception message when the magic number or size value in a bytecode
   file is truncated.
 
index c5f16e580ff8cc0850c893cc0c2360c8abf697b6..8c4c7f3fa5a3e28d1fbc3b178569b9a3dd00d5d6 100644 (file)
@@ -723,6 +723,9 @@ Py_NO_ENABLE_SHARED to find out.  Also support MS_NO_COREDLL for b/w compat */
 /* The size of `wchar_t', as computed by sizeof. */
 #define SIZEOF_WCHAR_T 2
 
+/* The size of `pid_t' (HANDLE). */
+#define SIZEOF_PID_T SIZEOF_VOID_P
+
 /* Define if you have the dl library (-ldl).  */
 /* #undef HAVE_LIBDL */