]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/basic/strv.h
basic/strv: add STRPTR_IN_SET
[thirdparty/systemd.git] / src / basic / strv.h
index 683ce83a2ae658261d9554a5cbd5161c51f048f9..fec2597db0b448583686b2a5f64d06fe8ca511ed 100644 (file)
@@ -141,6 +141,11 @@ void strv_print(char **l);
         })
 
 #define STR_IN_SET(x, ...) strv_contains(STRV_MAKE(__VA_ARGS__), x)
+#define STRPTR_IN_SET(x, ...)                                    \
+        ({                                                       \
+                const char* _x = (x);                            \
+                _x && strv_contains(STRV_MAKE(__VA_ARGS__), _x); \
+        })
 
 #define FOREACH_STRING(x, ...)                               \
         for (char **_l = ({                                  \