1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-02 02:21:44 +03:00

json: use new _align_() macro

This commit is contained in:
Lennart Poettering 2018-12-03 13:17:28 +01:00
parent 2ee1c55d6c
commit 90b365cee0

View File

@ -274,9 +274,9 @@ int json_log_internal(JsonVariant *variant, int level, int error, const char *fi
#define JSON_VARIANT_STRING_CONST(x) _JSON_VARIANT_STRING_CONST(UNIQ, (x))
#define _JSON_VARIANT_STRING_CONST(xq, x) \
#define _JSON_VARIANT_STRING_CONST(xq, x) \
({ \
__attribute__((__aligned__(2))) static const char UNIQ_T(json_string_const, xq)[] = (x); \
_align_(2) static const char UNIQ_T(json_string_const, xq)[] = (x); \
assert((((uintptr_t) UNIQ_T(json_string_const, xq)) & 1) == 0); \
(JsonVariant*) ((uintptr_t) UNIQ_T(json_string_const, xq) + 1); \
})