mirror of
git://github.com/lxc/lxc
synced 2025-09-01 13:31:38 +00:00
macro: add STRLITERALLEN() and STRARRAYLEN()
sizeof() implementation for string literals and string arrays that makes it behave like strlen() for strings. Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
@@ -348,4 +348,7 @@ extern int __build_bug_on_failed;
|
|||||||
#define LXC_INVALID_UID ((uid_t)-1)
|
#define LXC_INVALID_UID ((uid_t)-1)
|
||||||
#define LXC_INVALID_GID ((gid_t)-1)
|
#define LXC_INVALID_GID ((gid_t)-1)
|
||||||
|
|
||||||
|
#define STRLITERALLEN(x) (sizeof(""x"") - 1)
|
||||||
|
#define STRARRAYLEN(x) (sizeof(x) - 1)
|
||||||
|
|
||||||
#endif /* __LXC_MACRO_H */
|
#endif /* __LXC_MACRO_H */
|
||||||
|
Reference in New Issue
Block a user