Commit eb03303
authored
Replace the dummy arg from compound initializers in the C API with more macro magic (#4696)
The dummy argument {fmt_int} was there as a workaround for MSVC and to
avoid needing to rely on another GCC extension for zero-size arrays. Use
macro magic similar to FMT_NARG() instead that replaces the problematic
zero-size array with NULL.
In order to avoid a quadratic number of expansions, defer creating the
mapped argument list until after selection of whether to use NULL or
the fmt_arg array.
Signed-off-by: Ferdinand Bachmann <ferdinand.bachmann@yrlf.at>1 parent ab4f661 commit eb03303
1 file changed
+17
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | | - | |
| 133 | + | |
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
| |||
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
169 | | - | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
170 | 181 | | |
171 | 182 | | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
176 | 187 | | |
177 | 188 | | |
178 | 189 | | |
| |||
0 commit comments