Page MenuHomeFreeBSD

sys/_types.h: avoid use of __has_feature()
ClosedPublic

Authored by brooks on Dec 1 2025, 10:59 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Feb 17, 1:58 PM
Unknown Object (File)
Sat, Feb 7, 2:01 PM
Unknown Object (File)
Sun, Feb 1, 3:28 AM
Unknown Object (File)
Mon, Jan 26, 4:49 AM
Unknown Object (File)
Jan 13 2026, 6:37 PM
Unknown Object (File)
Jan 10 2026, 6:34 AM
Unknown Object (File)
Jan 9 2026, 7:14 PM
Unknown Object (File)
Jan 9 2026, 4:42 PM
Subscribers

Details

Summary

Only fairly recent GCC versions support and sys/_types.h must work with
quite old compilers and without sys/cdef.h being included. The prior
workaround works fine, but we can have the same effect with compiler
macro definitions.

This reverts commit 029a09f18032353a9ae874590b879322efc6e53a
This reverts commit 19728f31ae421f40e2b0b0c775f4eedd7f927be0

Effort: CHERI upstreaming
Fixes: 85ab981a8e4e ("sys/_types.h: define fallback __(u)intcap_t")
Sponsored by: Innovate UK

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/sys/_types.h
164

The most optimal gate would probably be !defined(__INTCAP_TYPE__) since it's a fundamental type provided by the compiler, but we seem to have forgotten to define that macro. I've filed a bug report on that lack https://github.com/CTSRD-CHERI/llvm-project/issues/796

This revision is now accepted and ready to land.Dec 1 2025, 7:07 PM

Switch to checking for SIZEOF_INTCAP. The compiler will define it
if it implements __intcap_t.

This revision now requires review to proceed.Dec 15 2025, 5:19 PM
This revision is now accepted and ready to land.Dec 16 2025, 6:46 AM
This revision was automatically updated to reflect the committed changes.