summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2020-10-31 05:16:20 -0700
committerGiampaolo Rodola <g.rodola@gmail.com>2020-10-31 05:16:20 -0700
commitd31a99e1e344fe3d22524f6819ef7c1d3af1b3a5 (patch)
tree9954a8bceb7799efa4df772bfcb8d95bdce20758
parenta66af060f47aa77c563670ebea33b5f0efe280b8 (diff)
downloadpsutil-d31a99e1e344fe3d22524f6819ef7c1d3af1b3a5.tar.gz
make some macros public
-rw-r--r--psutil/_psutil_common.c7
-rw-r--r--psutil/_psutil_common.h8
2 files changed, 8 insertions, 7 deletions
diff --git a/psutil/_psutil_common.c b/psutil/_psutil_common.c
index f821aba3..4178e0c0 100644
--- a/psutil/_psutil_common.c
+++ b/psutil/_psutil_common.c
@@ -199,13 +199,6 @@ int PSUTIL_WINVER;
SYSTEM_INFO PSUTIL_SYSTEM_INFO;
CRITICAL_SECTION PSUTIL_CRITICAL_SECTION;
-#define NT_FACILITY_MASK 0xfff
-#define NT_FACILITY_SHIFT 16
-#define NT_FACILITY(Status) \
- ((((ULONG)(Status)) >> NT_FACILITY_SHIFT) & NT_FACILITY_MASK)
-#define NT_NTWIN32(status) (NT_FACILITY(Status) == FACILITY_WIN32)
-#define WIN32_FROM_NTSTATUS(Status) (((ULONG)(Status)) & 0xffff)
-
// A wrapper around GetModuleHandle and GetProcAddress.
PVOID
diff --git a/psutil/_psutil_common.h b/psutil/_psutil_common.h
index 3162772e..bd2ae6b7 100644
--- a/psutil/_psutil_common.h
+++ b/psutil/_psutil_common.h
@@ -134,6 +134,14 @@ void convert_kvm_err(const char *syscall, char *errbuf);
#define MALLOC_ZERO(x) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (x))
#define FREE(x) HeapFree(GetProcessHeap(), 0, (x))
+ #define _NT_FACILITY_MASK 0xfff
+ #define _NT_FACILITY_SHIFT 16
+ #define _NT_FACILITY(Status) \
+ ((((ULONG)(Status)) >> _NT_FACILITY_SHIFT) & _NT_FACILITY_MASK)
+
+ #define NT_NTWIN32(status) (_NT_FACILITY(Status) == FACILITY_WIN32)
+ #define WIN32_FROM_NTSTATUS(Status) (((ULONG)(Status)) & 0xffff)
+
#define LO_T 1e-7
#define HI_T 429.4967296