git: 252500da3a45 - stable/15 - machine/ieeefp.h: include <sys/cdefs.h>

From: Piotr Kubaj <pkubaj_at_FreeBSD.org>
Date: Wed, 21 Oct 2026 10:17:48 UTC
The branch stable/15 has been updated by pkubaj:

URL: https://cgit.FreeBSD.org/src/commit/?id=252500da3a45a89d91c276db88f9669314cc2dfa

commit 252500da3a45a89d91c276db88f9669314cc2dfa
Author:     Piotr Kubaj <pkubaj@FreeBSD.org>
AuthorDate: 2026-10-14 16:04:02 +0000
Commit:     Piotr Kubaj <pkubaj@FreeBSD.org>
CommitDate: 2026-10-21 10:17:19 +0000

    machine/ieeefp.h: include <sys/cdefs.h>
    
    The <machine/ieeefp.h> headers wrap their deprecated FPU control
    prototypes in __BEGIN_DECLS/__END_DECLS but rely on the includer to
    have pulled in <sys/cdefs.h>.  Including <floatingpoint.h> first on
    arm, arm64, powerpc and riscv (or amd64 <machine/ieeefp.h> with
    __IEEEFP_NOINLINES__) fails with "unknown type name '__BEGIN_DECLS'".
    This breaks e.g. devel/py-pyinstaller.
    
    Suggested by:   jhb
    Reviewed by:    jhb
    MFC after:      1 week
    Differential Revision:  https://reviews.freebsd.org/D59659
    
    (cherry picked from commit 9d50245a0f1333e10cc1c4dda16878cd79a7c42b)
---
 sys/amd64/include/ieeefp.h   | 1 +
 sys/arm/include/ieeefp.h     | 2 ++
 sys/arm64/include/ieeefp.h   | 2 ++
 sys/powerpc/include/ieeefp.h | 2 ++
 sys/riscv/include/ieeefp.h   | 2 ++
 5 files changed, 9 insertions(+)

diff --git a/sys/amd64/include/ieeefp.h b/sys/amd64/include/ieeefp.h
index f9ec5bf83fd0..8f43dceb77c5 100644
--- a/sys/amd64/include/ieeefp.h
+++ b/sys/amd64/include/ieeefp.h
@@ -39,6 +39,7 @@
 
 /* Deprecated historical FPU control interface */
 
+#include <sys/cdefs.h>
 #include <x86/x86_ieeefp.h>
 
 /*
diff --git a/sys/arm/include/ieeefp.h b/sys/arm/include/ieeefp.h
index 57719b883d58..e9152dd25cbc 100644
--- a/sys/arm/include/ieeefp.h
+++ b/sys/arm/include/ieeefp.h
@@ -7,6 +7,8 @@
 #ifndef _MACHINE_IEEEFP_H_
 #define _MACHINE_IEEEFP_H_
 
+#include <sys/cdefs.h>
+
 /* Deprecated historical FPU control interface */
 
 /* FP exception codes */
diff --git a/sys/arm64/include/ieeefp.h b/sys/arm64/include/ieeefp.h
index 7f2ba092c507..6a3124acf9ed 100644
--- a/sys/arm64/include/ieeefp.h
+++ b/sys/arm64/include/ieeefp.h
@@ -10,6 +10,8 @@
 #ifndef _MACHINE_IEEEFP_H_
 #define	_MACHINE_IEEEFP_H_
 
+#include <sys/cdefs.h>
+
 /* Deprecated FPU control interface */
 
 /* FP exception codes */
diff --git a/sys/powerpc/include/ieeefp.h b/sys/powerpc/include/ieeefp.h
index 3aa92ff4522b..bbf9dcb07652 100644
--- a/sys/powerpc/include/ieeefp.h
+++ b/sys/powerpc/include/ieeefp.h
@@ -7,6 +7,8 @@
 #ifndef _MACHINE_IEEEFP_H_
 #define _MACHINE_IEEEFP_H_
 
+#include <sys/cdefs.h>
+
 /* Deprecated historical FPU control interface */
 
 typedef int fp_except_t;
diff --git a/sys/riscv/include/ieeefp.h b/sys/riscv/include/ieeefp.h
index 03a96e8a000f..3f1cd4c5e731 100644
--- a/sys/riscv/include/ieeefp.h
+++ b/sys/riscv/include/ieeefp.h
@@ -2,6 +2,8 @@
 #ifndef _MACHINE_IEEEFP_H_
 #define	_MACHINE_IEEEFP_H_
 
+#include <sys/cdefs.h>
+
 /* TODO */
 typedef int fp_except_t;