The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=b01e971fd39d10273a387788019457792873e81c
commit b01e971fd39d10273a387788019457792873e81c Author: Brooks Davis <bro...@freebsd.org> AuthorDate: 2025-06-11 16:39:01 +0000 Commit: Brooks Davis <bro...@freebsd.org> CommitDate: 2025-06-11 16:39:01 +0000 Don't rely on sys/_types.h including sys/cdefs.h These headers relied in __BEGIN_DECS/__END_DECLS being defined when sys/_types.h was included, but there's not a requirement that this be the case. Reviewed by: imp Exp-run by: antoine (PR 286274) Pull Request: https://github.com/freebsd/freebsd-src/pull/1595 --- contrib/libexecinfo/execinfo.h | 2 ++ include/dlfcn.h | 1 + lib/msun/src/math.h | 1 + sys/sys/procdesc.h | 1 + 4 files changed, 5 insertions(+) diff --git a/contrib/libexecinfo/execinfo.h b/contrib/libexecinfo/execinfo.h index 22460967e83c..8a3c36b2da21 100644 --- a/contrib/libexecinfo/execinfo.h +++ b/contrib/libexecinfo/execinfo.h @@ -32,6 +32,8 @@ #ifndef _EXECINFO_H_ #define _EXECINFO_H_ +#include <sys/cdefs.h> + #include <stddef.h> __BEGIN_DECLS diff --git a/include/dlfcn.h b/include/dlfcn.h index 89ec43b332e9..9a4ac0faf786 100644 --- a/include/dlfcn.h +++ b/include/dlfcn.h @@ -32,6 +32,7 @@ #ifndef _DLFCN_H_ #define _DLFCN_H_ +#include <sys/cdefs.h> #include <sys/_types.h> /* diff --git a/lib/msun/src/math.h b/lib/msun/src/math.h index be7b86144738..aecc652ea08a 100644 --- a/lib/msun/src/math.h +++ b/lib/msun/src/math.h @@ -15,6 +15,7 @@ #ifndef _MATH_H_ #define _MATH_H_ +#include <sys/cdefs.h> #include <sys/_types.h> #include <machine/_limits.h> diff --git a/sys/sys/procdesc.h b/sys/sys/procdesc.h index 4e8b06fb7377..81102dffa6ff 100644 --- a/sys/sys/procdesc.h +++ b/sys/sys/procdesc.h @@ -108,6 +108,7 @@ int procdesc_falloc(struct thread *, struct file **, int *, int, #else /* !_KERNEL */ +#include <sys/cdefs.h> #include <sys/_types.h> #ifndef _PID_T_DECLARED