chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
907809f
)
macro: add CHAR_TO_STR macro to make a one character string from a char
author
Lennart Poettering
<lennart@poettering.net>
Tue, 19 Mar 2013 19:00:55 +0000
(20:00 +0100)
committer
Lennart Poettering
<lennart@poettering.net>
Wed, 20 Mar 2013 21:58:40 +0000
(22:58 +0100)
src/shared/macro.h
patch
|
blob
|
history
diff --git
a/src/shared/macro.h
b/src/shared/macro.h
index e5c33ce5617653861dc9f53acae848709c75a864..80cb2f0892f9a2d41ae9918cb5644e99e6bca3f6 100644
(file)
--- a/
src/shared/macro.h
+++ b/
src/shared/macro.h
@@
-158,6
+158,8
@@
static inline size_t ALIGN_TO(size_t l, size_t ali) {
#define memzero(x,l) (memset((x), 0, (l)))
#define zero(x) (memzero(&(x), sizeof(x)))
+#define CHAR_TO_STR(x) ((char[2]) { x, 0 })
+
#define char_array_0(x) x[sizeof(x)-1] = 0;
#define IOVEC_SET_STRING(i, s) \