diff options
author | Guy Harris <guy@alum.mit.edu> | 2015-06-09 20:09:40 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2015-06-10 03:10:24 +0000 |
commit | 62c3bc3596e2ba9fa04f80bc7b49fe82802ce841 (patch) | |
tree | 08a059a5945cb0b803888c1a416e7d1bbf2fd8e8 /wsutil | |
parent | a10a41f5c7816617aa6aa413c46c8eba625cccff (diff) | |
download | wireshark-62c3bc3596e2ba9fa04f80bc7b49fe82802ce841.tar.gz wireshark-62c3bc3596e2ba9fa04f80bc7b49fe82802ce841.tar.bz2 wireshark-62c3bc3596e2ba9fa04f80bc7b49fe82802ce841.zip |
Squelch some type-clash warnings on Windows.
Define WS_INVALID_PID to be the appropriate "there is no process" value.
On UN*X, -1 works; the "pid" is actually a HANDLE for the process on
Windows, so INVALID_HANDLE is appropriate.
Cast HANDLE to intptr_t in the _cwait() call.
Change-Id: Ica2d2319f5c95ba41f590776a745fe040fe494d2
Reviewed-on: https://code.wireshark.org/review/8871
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'wsutil')
-rw-r--r-- | wsutil/processes.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/wsutil/processes.h b/wsutil/processes.h index ced8c1d71e..297c01c60e 100644 --- a/wsutil/processes.h +++ b/wsutil/processes.h @@ -30,11 +30,22 @@ extern "C" { #endif /* __cplusplus */ #ifdef _WIN32 +/* + * On Windows, a process ID is a HANDLE. + * Include <windows.h> to make sure HANDLE is defined. + */ #include <windows.h> -typedef HANDLE ws_process_id; /* on Windows, a process ID is a HANDLE */ +typedef HANDLE ws_process_id; + +#define WS_INVALID_PID INVALID_HANDLE #else -typedef pid_t ws_process_id; /* on UN\*X, a process ID is a pid_t */ +/* + * On UN*X, a process ID is a pid_t. + */ +typedef pid_t ws_process_id; + +#define WS_INVALID_PID -1 #endif #ifdef __cplusplus |