Index: bench/Benchmark.h |
diff --git a/bench/Benchmark.h b/bench/Benchmark.h |
index 5ba6e9110893b442f6952dfd9711c7468d03cf24..22b52ab4e879d65d061320b49f611697c7e375cf 100644 |
--- a/bench/Benchmark.h |
+++ b/bench/Benchmark.h |
@@ -13,11 +13,10 @@ |
#include "SkString.h" |
#include "SkTRegistry.h" |
-#define DEF_BENCH(code) \ |
-namespace { \ |
-static Benchmark* SK_MACRO_APPEND_LINE(factory)(void*) { code; } \ |
-BenchRegistry SK_MACRO_APPEND_LINE(g_R_)(SK_MACRO_APPEND_LINE(factory)); \ |
-} |
+#define DEF_BENCH3(code, N) \ |
+ static BenchRegistry gBench##N([](void*) -> Benchmark* { code; }); |
+#define DEF_BENCH2(code, N) DEF_BENCH3(code, N) |
+#define DEF_BENCH(code) DEF_BENCH2(code, __COUNTER__) |
/* |
* With the above macros, you can register benches as follows (at the bottom |