chiark / gitweb /
Version bump to v226.5
[elogind.git] / src / basic / macro.h
index 627d768b76bada29f5f7d106a13ca215a55470cf..7715c6e691289d054534102d3018edb7c6e2b16e 100644 (file)
@@ -23,6 +23,7 @@
 
 #include <assert.h>
 #include <sys/param.h>
+#include <sys/sysmacros.h>
 #include <sys/types.h>
 #include <sys/uio.h>
 #include <inttypes.h>
@@ -298,6 +299,9 @@ static inline unsigned long ALIGN_POWER2(unsigned long u) {
 #define PTR_TO_GID(p) ((gid_t) (((uintptr_t) (p))-1))
 #define GID_TO_PTR(u) ((void*) (((uintptr_t) (u))+1))
 
+#define PTR_TO_PID(p) ((pid_t) ((uintptr_t) p))
+#define PID_TO_PTR(p) ((void*) ((uintptr_t) p))
+
 #define memzero(x,l) (memset((x), 0, (l)))
 #define zero(x) (memzero(&(x), sizeof(x)))