From 96d11fc9dc742f338e39fe83b0d7e24e09ad66bc Mon Sep 17 00:00:00 2001 From: andy5995 Date: Wed, 7 May 2025 15:11:16 -0500 Subject: [PATCH 1/5] Fix MacOS warning (function declaration without prototype) pcg_basic.c.o -c ../subprojects/deckhandler/subprojects/pcg/pcg_basic.c ../subprojects/deckhandler/subprojects/pcg/pcg_basic.c:69:22: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes] uint32_t pcg32_random() --- subprojects/pcg/pcg_basic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subprojects/pcg/pcg_basic.c b/subprojects/pcg/pcg_basic.c index 8c2fd0d..1a2972e 100644 --- a/subprojects/pcg/pcg_basic.c +++ b/subprojects/pcg/pcg_basic.c @@ -66,7 +66,7 @@ uint32_t pcg32_random_r(pcg32_random_t* rng) return (xorshifted >> rot) | (xorshifted << ((-rot) & 31)); } -uint32_t pcg32_random() +uint32_t pcg32_random(void) { return pcg32_random_r(&pcg32_global); } @@ -98,7 +98,7 @@ uint32_t pcg32_boundedrand_r(pcg32_random_t* rng, uint32_t bound) // should usually terminate quickly; on average (assuming all bounds are // equally likely), 82.25% of the time, we can expect it to require just // one iteration. In the worst case, someone passes a bound of 2^31 + 1 - // (i.e., 2147483649), which invalidates almost 50% of the range. In + // (i.e., 2147483649), which invalidates almost 50% of the range. In // practice, bounds are typically small and only a tiny amount of the range // is eliminated. for (;;) { From 55502cba7b9eb4295e2e107c2c518a298a4c3883 Mon Sep 17 00:00:00 2001 From: andy5995 Date: Wed, 7 May 2025 15:11:28 -0500 Subject: [PATCH 2/5] CI: Add MacOS --- .github/workflows/macos.yml | 41 +++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/macos.yml diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml new file mode 100644 index 0000000..e31dc27 --- /dev/null +++ b/.github/workflows/macos.yml @@ -0,0 +1,41 @@ +name: MacOS +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} + cancel-in-progress: true + +on: + push: + branches: [ master ] + paths: + - '**' + - '!**.yml' + - '!**.md' + - '**/macos.yml' + + pull_request: + branches: [ master ] + paths: + - '**' + - '!**.yml' + - '!**.md' + - '**/macos.yml' + +jobs: + MacOS: + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + - name: Install Dependencies + run: | + brew update + brew install \ + meson + + - name: Meson setup + run: CFLAGS="-Werror" meson setup _build -Db_sanitize=address,undefined + + - name: Build + run: meson compile -C _build + + - name: Test + run: meson test -v -C _build From 1c0f606bbaf67dc16f0a63da27d4dabc30abdfcf Mon Sep 17 00:00:00 2001 From: andy5995 Date: Wed, 7 May 2025 15:11:43 -0500 Subject: [PATCH 3/5] CI: Add -Werror flag --- .github/workflows/linux.yml | 4 ++-- .github/workflows/windows.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 77b3be4..1fe75c7 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -1,4 +1,4 @@ -name: C/C++ CI +name: Linux concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} cancel-in-progress: true @@ -35,7 +35,7 @@ jobs: python3-dev - name: Meson setup - run: meson setup _build -Db_sanitize=address,undefined + run: CFLAGS="-Werror" meson setup _build -Db_sanitize=address,undefined - name: Build run: meson compile -C _build diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index d3a9be1..2e3887c 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -37,7 +37,7 @@ jobs: - name: Meson setup shell: msys2 {0} run: | - meson setup _build + CFLAGS="-Werror" meson setup _build - name: Build shell: msys2 {0} From 4b2bc72d5e9d1838fbd83b5d0a8bdb51f5760c11 Mon Sep 17 00:00:00 2001 From: andy5995 Date: Wed, 7 May 2025 15:15:58 -0500 Subject: [PATCH 4/5] docs: Add MacOS CI badge --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 894f17f..34f872f 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ [![Linux](https://github.com/theimpossibleastronaut/deckhandler/actions/workflows/linux.yml/badge.svg)](https://github.com/theimpossibleastronaut/deckhandler/actions/workflows/linux.yml) [![Windows](https://github.com/theimpossibleastronaut/deckhandler/actions/workflows/windows.yml/badge.svg)](https://github.com/theimpossibleastronaut/deckhandler/actions/workflows/windows.yml) +[![MacOS](https://github.com/Dealer-s-Choice/deckhandler/actions/workflows/macos.yml/badge.svg)](https://github.com/Dealer-s-Choice/deckhandler/actions/workflows/macos.yml) # deckhandler Library that will create a deck of cards and shuffle it. From 2f4e186bb5acbb444e90595484e312b67f7eb367 Mon Sep 17 00:00:00 2001 From: andy5995 Date: Wed, 7 May 2025 15:26:27 -0500 Subject: [PATCH 5/5] Remove -Werror from swig build --- .github/workflows/linux.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 1fe75c7..90dca61 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -45,7 +45,8 @@ jobs: cd _build meson test -v - - name: Test swig + - name: Test swig build run: | - meson setup _build --reconfigure -Dswig_lang=python + rm -rf _build + meson setup _build -Dswig_lang=python meson compile -C _build