From 4dd45f477e9d74d82d7e78ded9068119765130a8 Mon Sep 17 00:00:00 2001 From: trigaux Date: Tue, 8 Sep 2026 15:07:06 -0400 Subject: [PATCH 1/9] Add windows compatibility. --- .github/workflows/cmake.yml | 2 +- include/timeq/fast_time_queue.h | 6 +++++- include/timeq/time_queue.h | 6 +++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 4bdd17f..6b285d9 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -22,7 +22,7 @@ jobs: build: strategy: matrix: - os: [ macos-latest, ubuntu-22.04 ] + os: [ macos-latest, ubuntu-22.04, ubuntu-22.04-arm, windows-latest ] runs-on: ${{ matrix.os }} continue-on-error: true diff --git a/include/timeq/fast_time_queue.h b/include/timeq/fast_time_queue.h index db16db0..6d07c00 100644 --- a/include/timeq/fast_time_queue.h +++ b/include/timeq/fast_time_queue.h @@ -33,7 +33,11 @@ #include namespace timeq { -#define FORCE_INLINE __attribute__((always_inline)) +#ifdef _MSC_VER +#define FORCE_INLINE inline __forceinline +#else +#define FORCE_INLINE inline __attribute__((always_inline)) +#endif /** * @brief Aging element FIFO queue. diff --git a/include/timeq/time_queue.h b/include/timeq/time_queue.h index 045a97c..7c55bf2 100644 --- a/include/timeq/time_queue.h +++ b/include/timeq/time_queue.h @@ -33,7 +33,11 @@ #include namespace timeq { -#define FORCE_INLINE __attribute__((always_inline)) +#ifdef _MSC_VER +#define FORCE_INLINE inline __forceinline +#else +#define FORCE_INLINE inline __attribute__((always_inline)) +#endif /** * @brief Aging element FIFO queue. From 5814455701f1a5ccf485561bd2ef44692621d985 Mon Sep 17 00:00:00 2001 From: trigaux Date: Tue, 8 Sep 2026 15:15:26 -0400 Subject: [PATCH 2/9] Fix workflow for windows --- .github/workflows/cmake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 6b285d9..fe7e592 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -51,7 +51,7 @@ jobs: echo "CXX=/usr/bin/g++-12" >> $GITHUB_ENV - name: Configure CMake - run: cmake -B ${{github.workspace}}/build -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBUILD_TESTING=ON + run: cmake -B ${{github.workspace}}/build -DCMAKE_POLICY_VERSION_MINIMUM="3.5" -DCMAKE_BUILD_TYPE="${{env.BUILD_TYPE}}" -DBUILD_TESTING="ON" - name: Build run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -j From 7feec890ee0a36e2728b951e9b16ad0f88f95e92 Mon Sep 17 00:00:00 2001 From: trigaux Date: Tue, 8 Sep 2026 15:18:23 -0400 Subject: [PATCH 3/9] Test and bench on windows --- .github/workflows/cmake.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index fe7e592..b10ecdb 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -67,7 +67,7 @@ jobs: needs: build strategy: matrix: - os: [ macos-latest, ubuntu-22.04 ] + os: [ macos-latest, ubuntu-22.04, ubuntu-22.04-arm, windows-latest ] runs-on: ${{ matrix.os }} continue-on-error: true @@ -90,7 +90,7 @@ jobs: needs: build strategy: matrix: - os: [ macos-latest, ubuntu-22.04 ] + os: [ macos-latest, ubuntu-22.04, ubuntu-22.04-arm, windows-latest ] runs-on: ${{ matrix.os }} continue-on-error: true From 4fb3854d6576a20e78a1b16ec09e4d636aa82144 Mon Sep 17 00:00:00 2001 From: trigaux Date: Tue, 8 Sep 2026 15:46:21 -0400 Subject: [PATCH 4/9] Fix shell for windows bench --- .github/workflows/cmake.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index b10ecdb..ae148df 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -104,6 +104,7 @@ jobs: path: ${{github.workspace}}/build - name: Benchmark + shell: bash run: | chmod +x ${{github.workspace}}/build/benchmark/timeq_benchmark ${{github.workspace}}/build/benchmark/timeq_benchmark From b54893b8eef143c9350053cc232dfe8e591035f5 Mon Sep 17 00:00:00 2001 From: trigaux Date: Tue, 8 Sep 2026 15:56:03 -0400 Subject: [PATCH 5/9] Make bench safe to run. --- .github/workflows/cmake.yml | 6 +++--- benchmark/CMakeLists.txt | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index ae148df..88c6083 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -84,7 +84,7 @@ jobs: working-directory: ${{github.workspace}}/build run: | chmod -R +rx ${{github.workspace}}/build - ctest -C ${{env.BUILD_TYPE}} --output-on-failure + ctest -C ${{env.BUILD_TYPE}} --output-on-failure -E "benchmark" benchmark: needs: build @@ -106,5 +106,5 @@ jobs: - name: Benchmark shell: bash run: | - chmod +x ${{github.workspace}}/build/benchmark/timeq_benchmark - ${{github.workspace}}/build/benchmark/timeq_benchmark + chmod -R +rx ${{github.workspace}}/build + ctest -C ${{env.BUILD_TYPE}} -R "benchmark" diff --git a/benchmark/CMakeLists.txt b/benchmark/CMakeLists.txt index aabfddc..894306b 100644 --- a/benchmark/CMakeLists.txt +++ b/benchmark/CMakeLists.txt @@ -22,3 +22,5 @@ target_compile_options(timeq_benchmark PRIVATE ) target_link_libraries(timeq_benchmark PRIVATE timeq benchmark::benchmark_main) + +add_test(NAME timeq_benchmark COMMAND timeq_benchmark) From 3ff4bcb9bbcb2bc5698b1b33bfff613041617ddb Mon Sep 17 00:00:00 2001 From: trigaux Date: Tue, 8 Sep 2026 16:03:16 -0400 Subject: [PATCH 6/9] Undo shell --- .github/workflows/cmake.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 88c6083..57ded7d 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -104,7 +104,6 @@ jobs: path: ${{github.workspace}}/build - name: Benchmark - shell: bash run: | chmod -R +rx ${{github.workspace}}/build ctest -C ${{env.BUILD_TYPE}} -R "benchmark" From 752df00bf9292bda44552a878da2923eef0c52c4 Mon Sep 17 00:00:00 2001 From: trigaux Date: Tue, 8 Sep 2026 16:13:40 -0400 Subject: [PATCH 7/9] Modify readme. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1c227ec..d510cec 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ intervals have elapsed since the last update. ## Requirements - CMake 3.13 or newer -- A C++20 compiler (GCC, Clang, or Apple Clang) +- A C++20 compiler When built as the top-level project, test and benchmark dependencies (GoogleTest and Google Benchmark) are fetched automatically via [CPM.cmake](https://github.com/cpm-cmake/CPM.cmake). From b38c799703ac720f8d23599c420780a20e3d062c Mon Sep 17 00:00:00 2001 From: trigaux Date: Tue, 8 Sep 2026 16:17:24 -0400 Subject: [PATCH 8/9] Actually run the bench. --- .github/workflows/cmake.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 57ded7d..21df0ef 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -104,6 +104,7 @@ jobs: path: ${{github.workspace}}/build - name: Benchmark + working-directory: ${{github.workspace}}/build run: | chmod -R +rx ${{github.workspace}}/build ctest -C ${{env.BUILD_TYPE}} -R "benchmark" From beb976a0f97c2c2712825a2cfe2321e8dcbde310 Mon Sep 17 00:00:00 2001 From: trigaux Date: Tue, 8 Sep 2026 16:22:42 -0400 Subject: [PATCH 9/9] Show the benchmark run. --- .github/workflows/cmake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 21df0ef..330ee19 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -107,4 +107,4 @@ jobs: working-directory: ${{github.workspace}}/build run: | chmod -R +rx ${{github.workspace}}/build - ctest -C ${{env.BUILD_TYPE}} -R "benchmark" + ctest -C ${{env.BUILD_TYPE}} -R "benchmark" --verbose