diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2020-01-21 11:55:20 -0800 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2020-01-21 11:55:20 -0800 |
commit | a39d66047f3e3f9b65c212e3320c5268246d0b1a (patch) | |
tree | de29359b9a9a21fe5769bf36c4cf90e1ac1ed6dc | |
parent | d5a96e2cd8527b395f55bc0c1ff299841e4bac77 (diff) | |
download | psutil-a39d66047f3e3f9b65c212e3320c5268246d0b1a.tar.gz |
only handle int and long
-rw-r--r-- | psutil/_psutil_common.h | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/psutil/_psutil_common.h b/psutil/_psutil_common.h index 1e76a305..d47f25d9 100644 --- a/psutil/_psutil_common.h +++ b/psutil/_psutil_common.h @@ -26,17 +26,12 @@ static const int PSUTIL_CONN_NONE = 128; // Python 2 compatibility for PyArg_ParseTuple pid arg type handling. #if PY_MAJOR_VERSION == 2 - #if PSUTIL_SIZEOF_PID_T == SIZEOF_INT + // XXX: not bullet proof (long long case is missing). + #if PSUTIL_SIZEOF_PID_T == 4 #define _Py_PARSE_PID "i" - #elif PSUTIL_SIZEOF_PID_T == SIZEOF_LONG - #define _Py_PARSE_PID "l" - #elif PSUTIL_SIZEOF_PID_T == SIZEOF_LONG_LONG - #define _Py_PARSE_PID "L" #else - #error "sizeof(pid_t) is neither sizeof(int), sizeof(long) or " \ - "sizeof(long long)" + #define _Py_PARSE_PID "l" #endif - #undef PSUTIL_SIZEOF_PID_T #endif // ==================================================================== |