aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2026-05-01 18:07:11 +0000
committerDimitry Andric <dim@FreeBSD.org>2026-05-01 18:13:33 +0000
commit966fb94cb3575ccd39da211165d0858fd0eb0ef2 (patch)
tree9154ca199300cb745949e4dfd571382258b7bef0
parentdaeab702f9adbbb718ecf48e17de8dd619cfe7b8 (diff)
Define stdint.h macros unconditionally
Similar to glibc, define all the stdint.h macros such as `SIZE_MAX`, `UINT64_C`, etc unconditionally. I.e. no longer check whether `__STDC_CONSTANT_MACROS` or `__STDC_LIMIT_MACROS` are defined. See also <https://sourceware.org/bugzilla/show_bug.cgi?id=15366>. This is part of reverting base 00bee6fcd77f, which reverted an upstream libc++ commit that eliminated libc++'s stdint.h wrapper header. Submitted by: Nikolas Klauser <nikolasklauser@berlin.de> MFC after: 1 week Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D56746
-rw-r--r--sys/arm/include/_stdint.h8
-rw-r--r--sys/arm64/include/_stdint.h8
-rw-r--r--sys/powerpc/include/_stdint.h8
-rw-r--r--sys/riscv/include/_stdint.h8
-rw-r--r--sys/x86/include/_stdint.h8
5 files changed, 0 insertions, 40 deletions
diff --git a/sys/arm/include/_stdint.h b/sys/arm/include/_stdint.h
index 2ebc6ea4f89f..9f9b7eb8a554 100644
--- a/sys/arm/include/_stdint.h
+++ b/sys/arm/include/_stdint.h
@@ -33,8 +33,6 @@
#ifndef _MACHINE__STDINT_H_
#define _MACHINE__STDINT_H_
-#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS)
-
#define INT8_C(c) (c)
#define INT16_C(c) (c)
#define INT32_C(c) (c)
@@ -48,10 +46,6 @@
#define INTMAX_C(c) INT64_C(c)
#define UINTMAX_C(c) UINT64_C(c)
-#endif /* !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) */
-
-#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS)
-
/*
* ISO/IEC 9899:1999
* 7.18.2.1 Limits of exact-width integer types
@@ -176,6 +170,4 @@
#define WINT_WIDTH INT32_WIDTH
#endif /* __ISO_C_VISIBLE >= 2023 */
-#endif /* !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) */
-
#endif /* !_MACHINE__STDINT_H_ */
diff --git a/sys/arm64/include/_stdint.h b/sys/arm64/include/_stdint.h
index 0b360b8ab460..621e5ce53721 100644
--- a/sys/arm64/include/_stdint.h
+++ b/sys/arm64/include/_stdint.h
@@ -35,8 +35,6 @@
#ifndef _MACHINE__STDINT_H_
#define _MACHINE__STDINT_H_
-#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS)
-
#define INT8_C(c) (c)
#define INT16_C(c) (c)
#define INT32_C(c) (c)
@@ -50,10 +48,6 @@
#define INTMAX_C(c) INT64_C(c)
#define UINTMAX_C(c) UINT64_C(c)
-#endif /* !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) */
-
-#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS)
-
/*
* ISO/IEC 9899:1999
* 7.18.2.1 Limits of exact-width integer types
@@ -178,8 +172,6 @@
#define WINT_WIDTH INT32_WIDTH
#endif /* __ISO_C_VISIBLE >= 2023 */
-#endif /* !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) */
-
#endif /* !_MACHINE__STDINT_H_ */
#endif /* !__arm__ */
diff --git a/sys/powerpc/include/_stdint.h b/sys/powerpc/include/_stdint.h
index 6eb988f86ed7..68ae89e23cdc 100644
--- a/sys/powerpc/include/_stdint.h
+++ b/sys/powerpc/include/_stdint.h
@@ -40,8 +40,6 @@
#ifndef _MACHINE__STDINT_H_
#define _MACHINE__STDINT_H_
-#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS)
-
#define INT8_C(c) (c)
#define INT16_C(c) (c)
#define INT32_C(c) (c)
@@ -61,10 +59,6 @@
#define INTMAX_C(c) INT64_C(c)
#define UINTMAX_C(c) UINT64_C(c)
-#endif /* !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) */
-
-#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS)
-
#ifndef __INT64_C
#ifdef __LP64__
#define __INT64_C(c) (c ## L)
@@ -223,6 +217,4 @@
#define WINT_WIDTH INT32_WIDTH
#endif /* __ISO_C_VISIBLE >= 2023 */
-#endif /* !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) */
-
#endif /* !_MACHINE__STDINT_H_ */
diff --git a/sys/riscv/include/_stdint.h b/sys/riscv/include/_stdint.h
index 48080ecfe2cf..9afe01c8a318 100644
--- a/sys/riscv/include/_stdint.h
+++ b/sys/riscv/include/_stdint.h
@@ -31,8 +31,6 @@
#ifndef _MACHINE__STDINT_H_
#define _MACHINE__STDINT_H_
-#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS)
-
#define INT8_C(c) (c)
#define INT16_C(c) (c)
#define INT32_C(c) (c)
@@ -46,10 +44,6 @@
#define INTMAX_C(c) INT64_C(c)
#define UINTMAX_C(c) UINT64_C(c)
-#endif /* !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) */
-
-#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS)
-
/*
* ISO/IEC 9899:1999
* 7.18.2.1 Limits of exact-width integer types
@@ -174,6 +168,4 @@
#define WINT_WIDTH INT32_WIDTH
#endif /* __ISO_C_VISIBLE >= 2023 */
-#endif /* !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) */
-
#endif /* !_MACHINE__STDINT_H_ */
diff --git a/sys/x86/include/_stdint.h b/sys/x86/include/_stdint.h
index 2dea911b5c88..4c65b0f095ea 100644
--- a/sys/x86/include/_stdint.h
+++ b/sys/x86/include/_stdint.h
@@ -40,8 +40,6 @@
#ifndef _MACHINE__STDINT_H_
#define _MACHINE__STDINT_H_
-#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS)
-
#define INT8_C(c) (c)
#define INT16_C(c) (c)
#define INT32_C(c) (c)
@@ -61,10 +59,6 @@
#define INTMAX_C(c) INT64_C(c)
#define UINTMAX_C(c) UINT64_C(c)
-#endif /* !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) */
-
-#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS)
-
/*
* ISO/IEC 9899:1999
* 7.18.2.1 Limits of exact-width integer types
@@ -217,6 +211,4 @@
#define WINT_WIDTH INT32_WIDTH
#endif /* __ISO_C_VISIBLE >= 2023 */
-#endif /* !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) */
-
#endif /* !_MACHINE__STDINT_H_ */