Skip to content

Conversation

@jmcarp
Copy link
Contributor

@jmcarp jmcarp commented Dec 30, 2025

We only want to use the restrict keyword in C, not in C++. Under linux, darwin, etc., we can check for __STDC_VERSION__ to verify that we're compiling C and not C++. However, illumos defines __STDC_VERSION__ whether we're compiling C or C++. To ensure that we don't use the restrict keyword in C++ on illumos, this patch adds a check on __cplusplus as well, and skips restrict if it's defined.

This patch also adds a test workflow for illumos to avoid future regressions.

Before submitting this PR, run tools/run-clangcldocker.sh on your changes if you can. See the "Contributing" section in the README for details. It is acceptable to skip this formatting.

We only want to use the `restrict` keyword in C, not in C++. Under
linux, darwin, etc., we can check for `__STDC_VERSION__` to verify that
we're compiling C and not C++. However, illumos defines
`__STDC_VERSION__` whether we're compiling C *or* C++. To ensure that we
don't use the `restrict` keyword in C++ on illumos, this patch adds a
check on `__cplusplus` as well, and skips `restrict` if it's defined.

This patch also adds a test workflow for illumos to avoid future
regressions.
@lemire
Copy link
Member

lemire commented Dec 30, 2025

Looks good. Let us run the tests.

@lemire lemire merged commit 4fca0ae into RoaringBitmap:master Dec 30, 2025
17 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants