diff --git a/folly/tracing/StaticTracepoint.h b/folly/tracing/StaticTracepoint.h index 02e099bb3f4..7520e5b89e5 100644 --- a/folly/tracing/StaticTracepoint.h +++ b/folly/tracing/StaticTracepoint.h @@ -42,40 +42,13 @@ #define FOLLY_HAVE_SDT 0 -// Mark variadic macro args as unused from https://stackoverflow.com/a/31470425 -#define FOLLY_UNUSED0() -#define FOLLY_UNUSED1(a) (void)(a) -#define FOLLY_UNUSED2(a, b) (void)(a), FOLLY_UNUSED1(b) -#define FOLLY_UNUSED3(a, b, c) (void)(a), FOLLY_UNUSED2(b, c) -#define FOLLY_UNUSED4(a, b, c, d) (void)(a), FOLLY_UNUSED3(b, c, d) -#define FOLLY_UNUSED5(a, b, c, d, e) (void)(a), FOLLY_UNUSED4(b, c, d, e) -#define FOLLY_UNUSED6(a, b, c, d, e, f) (void)(a), FOLLY_UNUSED5(b, c, d, e, f) -#define FOLLY_UNUSED7(a, b, c, d, e, f, g) \ - (void)(a), FOLLY_UNUSED6(b, c, d, e, f, g) -#define FOLLY_UNUSED8(a, b, c, d, e, f, g, h) \ - (void)(a), FOLLY_UNUSED7(b, c, d, e, f, g, h) - -#define FOLLY_VA_NUM_ARGS_IMPL(_0, _1, _2, _3, _4, _5, _6, _7, _8, N, ...) N -#define FOLLY_VA_NUM_ARGS(...) \ - FOLLY_VA_NUM_ARGS_IMPL(100, ##__VA_ARGS__, 8, 7, 6, 5, 4, 3, 2, 1, 0) - -#define FOLLY_ALL_UNUSED_IMPL_(nargs) FOLLY_UNUSED##nargs -#define FOLLY_ALL_UNUSED_IMPL(nargs) FOLLY_ALL_UNUSED_IMPL_(nargs) - -#if defined(_MSC_VER) -#define FOLLY_ALL_UNUSED(...) -#else -#define FOLLY_ALL_UNUSED(...) \ - FOLLY_ALL_UNUSED_IMPL(FOLLY_VA_NUM_ARGS(__VA_ARGS__))(__VA_ARGS__) -#endif - -#define FOLLY_SDT(provider, name, ...) \ - do { \ - FOLLY_ALL_UNUSED(__VA_ARGS__); \ +#define FOLLY_SDT(provider, name, ...) \ + do { \ + [](auto const&...) {}(__VA_ARGS__); \ } while (0) #define FOLLY_SDT_WITH_SEMAPHORE(provider, name, ...) \ do { \ - FOLLY_ALL_UNUSED(__VA_ARGS__); \ + [](auto const&...) {}(__VA_ARGS__); \ } while (0) #define FOLLY_SDT_IS_ENABLED(provider, name) (false) #define FOLLY_SDT_SEMAPHORE(provider, name) \