Skip to content

Commit c29b64d

Browse files
committed
Cleanup the C API
1 parent eb03303 commit c29b64d

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

include/fmt/fmt-c.h

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ typedef signed char fmt_signed_char;
9696
# else
9797
typedef enum {} fmt_signed_char;
9898
# endif
99-
// Require modern MSVC with conformant preprocessor
99+
100+
// Require modern MSVC with conformant preprocessor.
100101
# if defined(_MSC_VER) && (!defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL)
101102
# error "C API requires MSVC 2019+ with /Zc:preprocessor flag."
102103
# endif
@@ -127,12 +128,12 @@ typedef enum {} fmt_signed_char;
127128
# define FMT_CAT(a, b) FMT_CAT_(a, b)
128129
# define FMT_CAT_(a, b) a##b
129130

130-
# define FMT_NARG_(_id, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, \
131-
_13, _14, _15, _16, N, ...) \
131+
# define FMT_NARG_(_unused, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, \
132+
_12, _13, _14, _15, _16, N, ...) \
132133
N
133-
# define FMT_NARG(_dummy, ...) \
134-
FMT_NARG_(dummy, ##__VA_ARGS__, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, \
135-
4, 3, 2, 1, 0)
134+
# define FMT_NARG(_unused, ...) \
135+
FMT_NARG_(, ##__VA_ARGS__, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, \
136+
3, 2, 1, 0)
136137

137138
# define FMT_MAP_0(...)
138139
# define FMT_MAP_1(f, a) f(a)
@@ -170,9 +171,9 @@ typedef enum {} fmt_signed_char;
170171

171172
// select between two expressions depending on whether __VA_ARGS__ is empty
172173
// expands to e if __VA_ARGS__ is empty and n otherwise
173-
# define FMT_VA_SELECT(e, n, ...) \
174-
FMT_NARG_(dummy, ##__VA_ARGS__, n, n, n, n, n, n, n, n, n, n, n, n, n, n, \
175-
n, n, e)
174+
# define FMT_VA_SELECT(e, n, ...) \
175+
FMT_NARG_(, ##__VA_ARGS__, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, \
176+
e)
176177

177178
# define FMT_MAKE_NULL(...) NULL
178179
# define FMT_MAKE_ARGLIST(...) \

0 commit comments

Comments
 (0)