diff options
author | Lennart Poettering <lennart@poettering.net> | 2013-03-19 20:00:55 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2013-03-20 22:58:40 +0100 |
commit | a9c55a882f021318fa728af78f398f4fb7ad7c85 (patch) | |
tree | ad261f3e6ad6447eab97dfd1c0b532e27af0216a /src/shared/macro.h | |
parent | 907809fc6a9867869b8a237663af2eda335d333e (diff) |
macro: add CHAR_TO_STR macro to make a one character string from a char
Diffstat (limited to 'src/shared/macro.h')
-rw-r--r-- | src/shared/macro.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/shared/macro.h b/src/shared/macro.h index e5c33ce561..80cb2f0892 100644 --- 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) \ |