From 2a92e0bc6c17bdd4cb1afbc657267c40514226d1 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 12 Dec 2024 11:31:16 +0900 Subject: [PATCH] string-table: make DUMP_STRING_TABLE() returns 0 Then, we can use it as === return DUMP_STRING_TABLE(...); === --- src/basic/string-table.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/basic/string-table.h b/src/basic/string-table.h index 639443d02b..83891eeb73 100644 --- a/src/basic/string-table.h +++ b/src/basic/string-table.h @@ -101,7 +101,7 @@ ssize_t string_table_lookup(const char * const *table, size_t len, const char *k _DEFINE_STRING_TABLE_LOOKUP_FROM_STRING_FALLBACK(name,type,max,static) #define DUMP_STRING_TABLE(name,type,max) \ - do { \ + ({ \ flockfile(stdout); \ for (type _k = 0; _k < (max); _k++) { \ const char *_t; \ @@ -112,4 +112,5 @@ ssize_t string_table_lookup(const char * const *table, size_t len, const char *k fputc_unlocked('\n', stdout); \ } \ funlockfile(stdout); \ - } while (false) + 0; \ + })