Skip to content

Commit

Permalink
Revert "Break static trace point unused variable warnings on unsuppor…
Browse files Browse the repository at this point in the history
…ted platforms"

This reverts commit b85c08e.
  • Loading branch information
barracuda156 committed Jun 8, 2024
1 parent 1235b47 commit f2bdbe9
Showing 1 changed file with 2 additions and 37 deletions.
39 changes: 2 additions & 37 deletions folly/tracing/StaticTracepoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,49 +42,14 @@

#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__); \
} while (0)
#define FOLLY_SDT_WITH_SEMAPHORE(provider, name, ...) \
do { \
FOLLY_ALL_UNUSED(__VA_ARGS__); \
} while (0)
#define FOLLY_SDT_IS_ENABLED(provider, name) (false)
#define FOLLY_SDT_SEMAPHORE(provider, name) \
folly_sdt_semaphore_##provider##_##name
#define FOLLY_SDT_DEFINE_SEMAPHORE(provider, name) \
extern "C" { \
unsigned short FOLLY_SDT_SEMAPHORE(provider, name); \
}
#define FOLLY_SDT_DECLARE_SEMAPHORE(provider, name) \
extern "C" unsigned short FOLLY_SDT_SEMAPHORE(provider, name)
#define FOLLY_SDT_DEFINE_SEMAPHORE(provider, name)
#define FOLLY_SDT_DECLARE_SEMAPHORE(provider, name)

#endif

0 comments on commit f2bdbe9

Please sign in to comment.