git: 9d50245a0f13 - main - machine/ieeefp.h: include <sys/cdefs.h>

From: Piotr Kubaj <pkubaj_at_FreeBSD.org>
Date: Wed, 14 Oct 2026 16:06:53 UTC
The branch main has been updated by pkubaj:

URL: https://cgit.FreeBSD.org/src/commit/?id=9d50245a0f1333e10cc1c4dda16878cd79a7c42b

commit 9d50245a0f1333e10cc1c4dda16878cd79a7c42b
Author:     Piotr Kubaj <pkubaj@FreeBSD.org>
AuthorDate: 2026-10-14 16:04:02 +0000
Commit:     Piotr Kubaj <pkubaj@FreeBSD.org>
CommitDate: 2026-10-14 16:06:42 +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
---
 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 829e167aefae..0c4319ff01de 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 84b554a04c65..2d764ecd90b8 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;