Skip to content

Commit

Permalink
Undo incorrect "fix" for old linux headers.
Browse files Browse the repository at this point in the history
I have used #if defined(...) to check for enum values, which is... simply incorrect and not possible.

Removing this check again. If compilation does not work, define the macro ANKERL_NANOBENCH_DISABLE_PERF_COUNTERS.
  • Loading branch information
martinus committed Jun 10, 2021
1 parent 2d6158a commit 3e9e38a
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 14 deletions.
2 changes: 1 addition & 1 deletion docs/CODE_OF_CONDUCT.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@


<div class="version">
v4.3.4
v4.3.5
</div>


Expand Down
2 changes: 1 addition & 1 deletion docs/comparison.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@


<div class="version">
v4.3.4
v4.3.5
</div>


Expand Down
2 changes: 1 addition & 1 deletion docs/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@


<div class="version">
v4.3.4
v4.3.5
</div>


Expand Down
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@


<div class="version">
v4.3.4
v4.3.5
</div>


Expand Down
2 changes: 1 addition & 1 deletion docs/license.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@


<div class="version">
v4.3.4
v4.3.5
</div>


Expand Down
2 changes: 1 addition & 1 deletion docs/reference.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@


<div class="version">
v4.3.4
v4.3.5
</div>


Expand Down
2 changes: 1 addition & 1 deletion docs/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@


<div class="version">
v4.3.4
v4.3.5
</div>


Expand Down
2 changes: 1 addition & 1 deletion docs/tutorial.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@


<div class="version">
v4.3.4
v4.3.5
</div>


Expand Down
2 changes: 1 addition & 1 deletion src/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
project = 'nanobench'
copyright = '2019-2021 Martin Ankerl <[email protected]>'
author = 'Martin Ankerl'
version = 'v4.3.4'
version = 'v4.3.5'

# -- General configuration ---------------------------------------------------

Expand Down
7 changes: 2 additions & 5 deletions src/include/nanobench.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
// see https://semver.org/
#define ANKERL_NANOBENCH_VERSION_MAJOR 4 // incompatible API changes
#define ANKERL_NANOBENCH_VERSION_MINOR 3 // backwards-compatible changes
#define ANKERL_NANOBENCH_VERSION_PATCH 4 // backwards-compatible bug fixes
#define ANKERL_NANOBENCH_VERSION_PATCH 5 // backwards-compatible bug fixes

///////////////////////////////////////////////////////////////////////////////////////////////////
// public facing api - as minimal as possible
Expand Down Expand Up @@ -88,10 +88,7 @@
} while (0)
#endif

#if defined(__linux__) && defined(PERF_EVENT_IOC_ID) && defined(PERF_COUNT_HW_REF_CPU_CYCLES) && defined(PERF_FLAG_FD_CLOEXEC) && \
!defined(ANKERL_NANOBENCH_DISABLE_PERF_COUNTERS)
// only enable perf counters on kernel 3.14 which seems to have all the necessary defines. The three PERF_... defines are not in
// kernel 2.6.32 (all others are).
#if defined(__linux__) && !defined(ANKERL_NANOBENCH_DISABLE_PERF_COUNTERS)
# define ANKERL_NANOBENCH_PRIVATE_PERF_COUNTERS() 1
#else
# define ANKERL_NANOBENCH_PRIVATE_PERF_COUNTERS() 0
Expand Down

0 comments on commit 3e9e38a

Please sign in to comment.