File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change 33
44#include < string>
55
6+ #ifdef CODSPEED_INSTRUMENTATION
67#include " callgrind.h"
8+ #endif
79
810inline std::string get_version () {
911#ifdef CODSPEED_VERSION
@@ -13,6 +15,7 @@ inline std::string get_version() {
1315#endif
1416}
1517
18+ #ifdef CODSPEED_INSTRUMENTATION
1619inline bool measurement_is_instrumented () { return RUNNING_ON_VALGRIND; }
1720
1821inline void measurement_set_metadata () {
@@ -30,5 +33,12 @@ __attribute__((always_inline)) inline void measurement_stop(
3033 CALLGRIND_STOP_INSTRUMENTATION;
3134 CALLGRIND_DUMP_STATS_AT (name.c_str ());
3235};
36+ #else
37+ // Stub implementations for non-instrumentation builds
38+ inline bool measurement_is_instrumented () { return false ; }
39+ inline void measurement_set_metadata () {}
40+ inline void measurement_start () {}
41+ inline void measurement_stop (const std::string &name) {}
42+ #endif
3343
3444#endif // MEASUREMENT_H
Original file line number Diff line number Diff line change @@ -46,6 +46,10 @@ std::string extract_lambda_namespace(const std::string &pretty_func) {
4646 return extract_namespace_clang (pretty_func);
4747#elif __GNUC__
4848 return extract_namespace_gcc (pretty_func);
49+ #elif _MSC_VER
50+ // MSVC doesn't support __PRETTY_FUNCTION__ in the same way
51+ // Return empty string as fallback for Windows
52+ return {};
4953#else
5054#error "Unsupported compiler"
5155#endif
You can’t perform that action at this time.
0 commit comments