diff options
author | Nick Mathewson <nickm@torproject.org> | 2020-03-05 08:23:32 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2020-03-05 08:23:32 -0500 |
commit | 686494f0f71b9235399b8241aba3e0c2fcb03ea1 (patch) | |
tree | 39256173e40ef50d45cc35c22561da9279f9753b /src/ext/ht.h | |
parent | edc0bf5089df13d1d6a246e67bddb484ac99ad59 (diff) | |
parent | b5ccdd978ea138cde92b3513c9d653ba18b8b463 (diff) | |
download | tor-686494f0f71b9235399b8241aba3e0c2fcb03ea1.tar.gz tor-686494f0f71b9235399b8241aba3e0c2fcb03ea1.zip |
Merge branch 'clang_format_prep_3'
Diffstat (limited to 'src/ext/ht.h')
-rw-r--r-- | src/ext/ht.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/ext/ht.h b/src/ext/ht.h index 9d4add1936..4bfce36903 100644 --- a/src/ext/ht.h +++ b/src/ext/ht.h @@ -232,6 +232,10 @@ ht_string_hash(const char *s) #define HT_ASSERT_(x) (void)0 #endif +/* Macro put at the end of the end of a macro definition so that it + * consumes the following semicolon at file scope. Used only inside ht.h. */ +#define HT_EAT_SEMICOLON__ struct ht_semicolon_eater + #define HT_PROTOTYPE(name, type, field, hashfn, eqfn) \ int name##_HT_GROW(struct name *ht, unsigned min_capacity); \ void name##_HT_CLEAR(struct name *ht); \ @@ -413,7 +417,8 @@ ht_string_hash(const char *s) } \ return NULL; \ } \ - } + } \ + HT_EAT_SEMICOLON__ #define HT_GENERATE2(name, type, field, hashfn, eqfn, load, reallocarrayfn, \ freefn) \ @@ -538,7 +543,8 @@ ht_string_hash(const char *s) if (n != head->hth_n_entries) \ return 6; \ return 0; \ - } + } \ + HT_EAT_SEMICOLON__ #define HT_GENERATE(name, type, field, hashfn, eqfn, load, mallocfn, \ reallocfn, freefn) \ |