Skip to content

Commit 2e4d3e6

Browse files
committed
ck: recognize _KERNEL on Linux cross-builds
Use the Linux kernel header path when either __KERNEL__ or _KERNEL is defined so Ubuntu-based cross-builds do not fall back to missing hosted headers like limits.h and stdint.h. AI-Assisted-by: OpenAI Codex (GPT-5) Signed-off-by: Lucas Holt <luke@foolishgames.com>
1 parent 223a489 commit 2e4d3e6

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

sys/contrib/ck/include/ck_limits.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
* SUCH DAMAGE.
2525
*/
2626

27-
#if defined(__linux__) && defined(__KERNEL__)
27+
#if defined(__linux__) && (defined(__KERNEL__) || defined(_KERNEL))
2828
#include <linux/kernel.h>
2929

3030
#ifndef UINT8_MAX
@@ -45,4 +45,4 @@
4545
#include <sys/limits.h>
4646
#else
4747
#include <limits.h>
48-
#endif /* __linux__ && __KERNEL__ */
48+
#endif /* __linux__ && (__KERNEL__ || _KERNEL) */

sys/contrib/ck/include/ck_stdint.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@
2424
* SUCH DAMAGE.
2525
*/
2626

27-
#if defined(__linux__) && defined(__KERNEL__)
27+
#if defined(__linux__) && (defined(__KERNEL__) || defined(_KERNEL))
2828
#include <linux/kernel.h>
2929
#include <linux/types.h>
3030
#elif defined(__MidnightBSD__) && defined(_KERNEL)
3131
#include <sys/stdint.h>
3232
#else
3333
#include <stdint.h>
34-
#endif /* __linux__ && __KERNEL__ */
34+
#endif /* __linux__ && (__KERNEL__ || _KERNEL) */

0 commit comments

Comments
 (0)