summaryrefslogtreecommitdiff
path: root/psutil/_psutil_common.h
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2020-02-13 13:21:54 -0800
committerGiampaolo Rodola <g.rodola@gmail.com>2020-02-13 13:21:54 -0800
commit573886fa81db2c4b0ae9d296fa0fe1ac9055f3f8 (patch)
treeaf5e4cd391951570340176ff43c912696c5df46c /psutil/_psutil_common.h
parentf0b87e1f7dc6f666bd48e26b7a1f84975d7b09b8 (diff)
downloadpsutil-573886fa81db2c4b0ae9d296fa0fe1ac9055f3f8.tar.gz
#1672: warning pre-processor directive don't work on win + py2; also if struct.calcsize('l') < 8 assume int
Diffstat (limited to 'psutil/_psutil_common.h')
-rw-r--r--psutil/_psutil_common.h11
1 files changed, 4 insertions, 7 deletions
diff --git a/psutil/_psutil_common.h b/psutil/_psutil_common.h
index 9e1ef887..97543206 100644
--- a/psutil/_psutil_common.h
+++ b/psutil/_psutil_common.h
@@ -38,10 +38,10 @@ static const int PSUTIL_CONN_NONE = 128;
// SIZEOF_INT|LONG is missing on Linux + PyPy (only?).
// SIZEOF_PID_T is missing on Windows + Python2.
-// In we can't determine pid_t size we assume it's an (int).
-// On all UNIX platforms I've seen pid_t is defined as an int.
-// _getpid() on Windows returns an int. We can't be 100% sure though,
-// (in that case we'd probably get compiler warnings).
+// In this case we guess it from setup.py. It's not 100% bullet proof,
+// If wrong we'll probably get compiler warnings.
+// FWIW on all UNIX platforms I've seen pid_t is defined as an int.
+// _getpid() on Windows also returns an int.
#if !defined(SIZEOF_INT)
#define SIZEOF_INT 4
#endif
@@ -49,9 +49,6 @@ static const int PSUTIL_CONN_NONE = 128;
#define SIZEOF_LONG 8
#endif
#if !defined(SIZEOF_PID_T)
- #if PSUTIL_SIZEOF_PID_T != 4
- #warning "SIZEOF_PID_T was guessed"
- #endif
#define SIZEOF_PID_T PSUTIL_SIZEOF_PID_T // set as a macro in setup.py
#endif