From 406d157891ac529b6b04060c31a3860544d1f2c1 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Thu, 11 Feb 2021 11:51:16 -0800 Subject: [PATCH] Add stringify macro to utils Add macros for stringifying either the name of a macro or its value. In keeping with making our utils/ sort of look like kernel code, we use the kernel stringify names. Signed-off-by: Zach Brown --- utils/src/util.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/utils/src/util.h b/utils/src/util.h index ab195d9d..b504a5c0 100644 --- a/utils/src/util.h +++ b/utils/src/util.h @@ -114,4 +114,7 @@ static inline int memcmp_lens(const void *a, int a_len, int get_path(char *path, int flags); int read_block(int fd, u64 blkno, int shift, void **ret_val); +#define __stringify_1(x) #x +#define __stringify(x) __stringify_1(x) + #endif