From c4a85c64fa22c9663880ed07407cd64eaf5921f1 Mon Sep 17 00:00:00 2001 From: Christian von Elm Date: Sun, 8 Dec 2024 16:00:21 +0100 Subject: [PATCH] Revert "fix build tests" This reverts commit 05299b915d7c948f39efc581f2471d8063f80edf. --- include/lo2s/perf/event.hpp | 13 +++++++------ src/perf/event_provider.cpp | 15 +++++++++++---- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/include/lo2s/perf/event.hpp b/include/lo2s/perf/event.hpp index 53ceb8d7..ca0ad958 100644 --- a/include/lo2s/perf/event.hpp +++ b/include/lo2s/perf/event.hpp @@ -32,17 +32,19 @@ #include #include +#ifndef USE_HW_BREAKPOINT_COMPAT extern "C" { -#include - -#ifndef USE_HW_BREAKPOINT_COMPAT #include +#include +} #else +extern "C" +{ #include #include -#endif } +#endif namespace lo2s { @@ -121,8 +123,7 @@ class Event unit_ = unit; } - void set_clock_attrs([[maybe_unused]] const bool& use_clockid, - [[maybe_unused]] const clockid_t& clockid) + void set_clock_attrs(const bool& use_clockid, const clockid_t& clockid) { #ifndef USE_HW_BREAKPOINT_COMPAT attr_.use_clockid = use_clockid; diff --git a/src/perf/event_provider.cpp b/src/perf/event_provider.cpp index 9b003c7e..bac0d6fb 100644 --- a/src/perf/event_provider.cpp +++ b/src/perf/event_provider.cpp @@ -51,10 +51,7 @@ extern "C" namespace { -#define PERF_EVENT(name, type, id) \ - { \ - (name), (type), (id) \ - } +#define PERF_EVENT(name, type, id) { (name), (type), (id) } #define PERF_EVENT_HW(name, id) PERF_EVENT(name, PERF_TYPE_HARDWARE, PERF_COUNT_HW_##id) #define PERF_EVENT_SW(name, id) PERF_EVENT(name, PERF_TYPE_SOFTWARE, PERF_COUNT_SW_##id) @@ -148,6 +145,16 @@ inline constexpr std::size_t array_size(T (&)[N]) { return N; } + +constexpr std::uint64_t operator"" _u64(unsigned long long int lit) +{ + return static_cast(lit); +} + +constexpr std::uint64_t bit(int bitnumber) +{ + return static_cast(1_u64 << bitnumber); +} } // namespace namespace lo2s