git: 0a64d16cef17 - main - sys/_types.h: avoid use of __has_feature()

From: Brooks Davis <brooks_at_FreeBSD.org>
Date: Fri, 09 Jan 2026 14:42:47 UTC
The branch main has been updated by brooks:

URL: https://cgit.FreeBSD.org/src/commit/?id=0a64d16cef172bd3c809a8dc9035cd7d981b2951

commit 0a64d16cef172bd3c809a8dc9035cd7d981b2951
Author:     Brooks Davis <brooks@FreeBSD.org>
AuthorDate: 2026-01-09 14:41:21 +0000
Commit:     Brooks Davis <brooks@FreeBSD.org>
CommitDate: 2026-01-09 14:42:00 +0000

    sys/_types.h: avoid use of __has_feature()
    
    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.  In this specific case, compilers that define the
    __intcap_t builtin type will define __SIZEOF_INTCAP__.
    
    This reverts commit 029a09f18032353a9ae874590b879322efc6e53a
    This reverts commit 19728f31ae421f40e2b0b0c775f4eedd7f927be0
    
    Reviewed by:    imp, des, kib, emaste
    Effort:         CHERI upstreaming
    Fixes:          85ab981a8e4e ("sys/_types.h: define fallback __(u)intcap_t")
    Sponsored by:   Innovate UK
    Differential Revision:  https://reviews.freebsd.org/D54009
---
 sys/sys/_types.h | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/sys/sys/_types.h b/sys/sys/_types.h
index 2e622090e81d..a2ee83a862da 100644
--- a/sys/sys/_types.h
+++ b/sys/sys/_types.h
@@ -161,10 +161,7 @@ typedef	int		__cpulevel_t;	/* level parameter for cpuset. */
 typedef int		__cpusetid_t;	/* cpuset identifier. */
 typedef __int64_t	__daddr_t;	/* bwrite(3), FIOBMAP2, etc */
 
-#ifndef __has_feature
-#define __has_feature(x)        0
-#endif
-#if !__has_feature(capabilities)
+#ifndef __SIZEOF_INTCAP__
 /*
  * On non-CHERI systems, define __(u)intcap_t to __(u)intptr_t so that
  * hybrid-C code which needs to be explicitly aware of capabilities can