chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
everywhere: port everything to sigprocmask_many() and friends
[elogind.git]
/
src
/
shared
/
macro.h
diff --git
a/src/shared/macro.h
b/src/shared/macro.h
index 7f89951d62e00ee5f68809e017c2572f1e174770..cc1c9e73c08bddcbe39ebee5ac221a14b6d547f1 100644
(file)
--- a/
src/shared/macro.h
+++ b/
src/shared/macro.h
@@
-256,6
+256,15
@@
static inline unsigned long ALIGN_POWER2(unsigned long u) {
} \
} while (false)
} \
} while (false)
+#define assert_return_errno(expr, r, err) \
+ do { \
+ if (_unlikely_(!(expr))) { \
+ log_assert_failed_return(#expr, __FILE__, __LINE__, __PRETTY_FUNCTION__); \
+ errno = err; \
+ return (r); \
+ } \
+ } while (false)
+
#define PTR_TO_INT(p) ((int) ((intptr_t) (p)))
#define INT_TO_PTR(u) ((void *) ((intptr_t) (u)))
#define PTR_TO_UINT(p) ((unsigned int) ((uintptr_t) (p)))
#define PTR_TO_INT(p) ((int) ((intptr_t) (p)))
#define INT_TO_PTR(u) ((void *) ((intptr_t) (u)))
#define PTR_TO_UINT(p) ((unsigned int) ((uintptr_t) (p)))
@@
-458,4
+467,7
@@
do { \
} \
struct __useless_struct_to_allow_trailing_semicolon__
} \
struct __useless_struct_to_allow_trailing_semicolon__
+#define CMSG_FOREACH(cmsg, mh) \
+ for ((cmsg) = CMSG_FIRSTHDR(mh); (cmsg); (cmsg) = CMSG_NXTHDR((mh), (cmsg)))
+
#include "log.h"
#include "log.h"