chiark / gitweb /
service: properly handle if the main process is down and we wait for the cgroup to...
[elogind.git] / src / macro.h
index 763a4de27ad8b7dafce11cc7655c2a114b4e684c..acfc277517296cb2da8b1625ec223f9e0fc286cd 100644 (file)
@@ -1,4 +1,4 @@
-/*-*- Mode: C; c-basic-offset: 8 -*-*/
+/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
 
 #ifndef foomacrohfoo
 #define foomacrohfoo
@@ -38,6 +38,9 @@
 #define _weak_ __attribute__ ((weak))
 #define _likely_(x) (__builtin_expect(!!(x),1))
 #define _unlikely_(x) (__builtin_expect(!!(x),0))
+#define _public_ __attribute__ ((visibility("default")))
+#define _hidden_ __attribute__ ((visibility("hidden")))
+#define _weakref_(x) __attribute__((weakref(#x)))
 
 /* Rounds up */
 static inline size_t ALIGN(size_t l) {
@@ -106,12 +109,18 @@ static inline size_t ALIGN(size_t l) {
 #define PTR_TO_UINT32(p) ((uint32_t) ((uintptr_t) (p)))
 #define UINT32_TO_PTR(u) ((void*) ((uintptr_t) (u)))
 
+#define PTR_TO_ULONG(p) ((unsigned long) ((uintptr_t) (p)))
+#define ULONG_TO_PTR(u) ((void*) ((uintptr_t) (u)))
+
 #define PTR_TO_INT(p) ((int) ((intptr_t) (p)))
 #define INT_TO_PTR(u) ((void*) ((intptr_t) (u)))
 
 #define TO_INT32(p) ((int32_t) ((intptr_t) (p)))
 #define INT32_TO_PTR(u) ((void*) ((intptr_t) (u)))
 
+#define PTR_TO_LONG(p) ((long) ((intptr_t) (p)))
+#define LONG_TO_PTR(u) ((void*) ((intptr_t) (u)))
+
 #define memzero(x,l) (memset((x), 0, (l)))
 #define zero(x) (memzero(&(x), sizeof(x)))