mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-04 03:38:05 +02:00
utils: add NM_UTILS_STRING_LOOKUP_TABLE_ITEM() macro
This commit is contained in:
parent
0ce83890bf
commit
8956ea661c
1 changed files with 3 additions and 0 deletions
|
|
@ -260,6 +260,9 @@ const char *nm_utils_enum2str (const NMUtilsEnum2StrDesc *descs,
|
|||
|
||||
/*****************************************************************************/
|
||||
|
||||
#define NM_UTILS_STRING_LOOKUP_TABLE_ITEM(v, n) [v] = n
|
||||
#define NM_UTILS_STRING_LOOKUP_TABLE_ITEM_S(v, n) NM_UTILS_STRING_LOOKUP_TABLE_ITEM(v, ""n"")
|
||||
|
||||
#define _NM_UTILS_STRING_LOOKUP_TABLE_DEFINE(scope, fcn_name, lookup_type, unknown_val, ...) \
|
||||
scope const char * \
|
||||
fcn_name (lookup_type idx) \
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue