File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change 44#include < string>
55#ifdef _WIN32
66#include < process.h>
7+ #define getpid _getpid
8+ #define ALWAYS_INLINE __forceinline
79#else
810#include < unistd.h>
11+ #define ALWAYS_INLINE __attribute__ ((always_inline))
912#endif
1013
1114extern " C" {
@@ -37,21 +40,17 @@ inline void measurement_set_metadata() {
3740 instrument_hooks_set_integration (g_hooks, " codspeed-cpp" , version.c_str ());
3841}
3942
40- __attribute__ ((always_inline)) inline void measurement_start() {
43+ ALWAYS_INLINE inline void measurement_start () {
4144 instrument_hooks_start_benchmark_inline (g_hooks);
4245}
4346
44- __attribute__ ((always_inline)) inline void measurement_stop() {
47+ ALWAYS_INLINE inline void measurement_stop () {
4548 instrument_hooks_stop_benchmark_inline (g_hooks);
4649}
4750
48- __attribute__ ((always_inline)) inline void measurement_set_executed_benchmark(
51+ ALWAYS_INLINE inline void measurement_set_executed_benchmark (
4952 const std::string& name) {
50- #ifdef _WIN32
51- auto current_pid = _getpid ();
52- #else
5353 auto current_pid = getpid ();
54- #endif
5554 instrument_hooks_executed_benchmark (g_hooks, current_pid, name.c_str ());
5655}
5756
You can’t perform that action at this time.
0 commit comments