Module Name: src Committed By: riastradh Date: Wed Oct 30 15:56:12 UTC 2024
Modified Files: src/include: langinfo.h monetary.h nl_types.h regex.h src/sys/arch/alpha/include: fenv.h src/sys/arch/arm/include: float.h src/sys/arch/hppa/include: float.h src/sys/arch/ia64/include: fenv.h limits.h src/sys/arch/m68k/include: fenv.h float.h src/sys/arch/mips/include: fenv.h float.h src/sys/arch/or1k/include: float.h src/sys/arch/powerpc/include: fenv.h src/sys/arch/riscv/include: float.h src/sys/arch/sh3/include: fenv.h src/sys/arch/sparc/include: float.h src/sys/arch/vax/include: math.h src/sys/sys: common_limits.h epoll.h ttycom.h Log Message: Sprinkle <sys/featuretest.h> where _*_SOURCE macros are consulted. Otherwise, the feature tests might come out wrong. For example, header files that check for _NETBSD_SOURCE won't get the default when no other _*_SOURCE macros are defined; header files that check for _POSIX_C_SOURCE might miss _XOPEN_SOURCE, which is supposed to imply a corresponding _POSIX_C_SOURCE. PR lib/58752: various header files test _*_SOURCE macros but don't include sys/featuretest.h To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/include/langinfo.h cvs rdiff -u -r1.4 -r1.5 src/include/monetary.h cvs rdiff -u -r1.13 -r1.14 src/include/nl_types.h cvs rdiff -u -r1.16 -r1.17 src/include/regex.h cvs rdiff -u -r1.3 -r1.4 src/sys/arch/alpha/include/fenv.h cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/include/float.h cvs rdiff -u -r1.8 -r1.9 src/sys/arch/hppa/include/float.h cvs rdiff -u -r1.3 -r1.4 src/sys/arch/ia64/include/fenv.h cvs rdiff -u -r1.10 -r1.11 src/sys/arch/ia64/include/limits.h cvs rdiff -u -r1.9 -r1.10 src/sys/arch/m68k/include/fenv.h cvs rdiff -u -r1.23 -r1.24 src/sys/arch/m68k/include/float.h cvs rdiff -u -r1.6 -r1.7 src/sys/arch/mips/include/fenv.h cvs rdiff -u -r1.19 -r1.20 src/sys/arch/mips/include/float.h cvs rdiff -u -r1.1 -r1.2 src/sys/arch/or1k/include/float.h cvs rdiff -u -r1.7 -r1.8 src/sys/arch/powerpc/include/fenv.h cvs rdiff -u -r1.1 -r1.2 src/sys/arch/riscv/include/float.h cvs rdiff -u -r1.3 -r1.4 src/sys/arch/sh3/include/fenv.h cvs rdiff -u -r1.12 -r1.13 src/sys/arch/sparc/include/float.h cvs rdiff -u -r1.9 -r1.10 src/sys/arch/vax/include/math.h cvs rdiff -u -r1.3 -r1.4 src/sys/sys/common_limits.h cvs rdiff -u -r1.2 -r1.3 src/sys/sys/epoll.h cvs rdiff -u -r1.22 -r1.23 src/sys/sys/ttycom.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/include/langinfo.h diff -u src/include/langinfo.h:1.10 src/include/langinfo.h:1.11 --- src/include/langinfo.h:1.10 Mon Aug 19 08:03:33 2013 +++ src/include/langinfo.h Wed Oct 30 15:56:10 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: langinfo.h,v 1.10 2013/08/19 08:03:33 joerg Exp $ */ +/* $NetBSD: langinfo.h,v 1.11 2024/10/30 15:56:10 riastradh Exp $ */ /* * Written by J.T. Conklin <j...@netbsd.org> @@ -9,6 +9,7 @@ #define _LANGINFO_H_ #include <sys/cdefs.h> +#include <sys/featuretest.h> #include <nl_types.h> #define D_T_FMT ((nl_item)0) /* String for formatting date and Index: src/include/monetary.h diff -u src/include/monetary.h:1.4 src/include/monetary.h:1.5 --- src/include/monetary.h:1.4 Sun Dec 8 02:15:02 2019 +++ src/include/monetary.h Wed Oct 30 15:56:10 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: monetary.h,v 1.4 2019/12/08 02:15:02 kre Exp $ */ +/* $NetBSD: monetary.h,v 1.5 2024/10/30 15:56:10 riastradh Exp $ */ /*- * Copyright (c) 2001 Alexey Zelkin <phan...@freebsd.org> @@ -32,6 +32,7 @@ #define _MONETARY_H_ #include <sys/cdefs.h> +#include <sys/featuretest.h> #include <machine/ansi.h> #ifdef _BSD_SIZE_T_ Index: src/include/nl_types.h diff -u src/include/nl_types.h:1.13 src/include/nl_types.h:1.14 --- src/include/nl_types.h:1.13 Mon Aug 19 08:03:33 2013 +++ src/include/nl_types.h Wed Oct 30 15:56:10 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: nl_types.h,v 1.13 2013/08/19 08:03:33 joerg Exp $ */ +/* $NetBSD: nl_types.h,v 1.14 2024/10/30 15:56:10 riastradh Exp $ */ /*- * Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -31,7 +31,9 @@ #ifndef _NL_TYPES_H_ #define _NL_TYPES_H_ + #include <sys/cdefs.h> +#include <sys/featuretest.h> #ifdef _NLS_PRIVATE /* Index: src/include/regex.h diff -u src/include/regex.h:1.16 src/include/regex.h:1.17 --- src/include/regex.h:1.16 Tue Feb 23 17:14:42 2021 +++ src/include/regex.h Wed Oct 30 15:56:10 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: regex.h,v 1.16 2021/02/23 17:14:42 christos Exp $ */ +/* $NetBSD: regex.h,v 1.17 2024/10/30 15:56:10 riastradh Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -75,6 +75,7 @@ #define _REGEX_H_ #include <sys/cdefs.h> +#include <sys/featuretest.h> #include <sys/types.h> /* types */ Index: src/sys/arch/alpha/include/fenv.h diff -u src/sys/arch/alpha/include/fenv.h:1.3 src/sys/arch/alpha/include/fenv.h:1.4 --- src/sys/arch/alpha/include/fenv.h:1.3 Sun Oct 27 21:27:10 2019 +++ src/sys/arch/alpha/include/fenv.h Wed Oct 30 15:56:10 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: fenv.h,v 1.3 2019/10/27 21:27:10 christos Exp $ */ +/* $NetBSD: fenv.h,v 1.4 2024/10/30 15:56:10 riastradh Exp $ */ /*- * Copyright (c) 2004-2005 David Schultz <d...@freebsd.org> @@ -31,6 +31,7 @@ #ifndef _ALPHA_FENV_H_ #define _ALPHA_FENV_H_ +#include <sys/featuretest.h> #include <sys/stdint.h> typedef __uint64_t fenv_t; Index: src/sys/arch/arm/include/float.h diff -u src/sys/arch/arm/include/float.h:1.8 src/sys/arch/arm/include/float.h:1.9 --- src/sys/arch/arm/include/float.h:1.8 Wed Jan 29 01:10:36 2014 +++ src/sys/arch/arm/include/float.h Wed Oct 30 15:56:11 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: float.h,v 1.8 2014/01/29 01:10:36 matt Exp $ */ +/* $NetBSD: float.h,v 1.9 2024/10/30 15:56:11 riastradh Exp $ */ /*- * Copyright (c) 2014 The NetBSD Foundation, Inc. @@ -33,6 +33,7 @@ #define _ARM_FLOAT_H_ #include <sys/cdefs.h> +#include <sys/featuretest.h> #ifdef __ARM_PCS_AAPCS64 Index: src/sys/arch/hppa/include/float.h diff -u src/sys/arch/hppa/include/float.h:1.8 src/sys/arch/hppa/include/float.h:1.9 --- src/sys/arch/hppa/include/float.h:1.8 Mon Jul 11 02:54:04 2011 +++ src/sys/arch/hppa/include/float.h Wed Oct 30 15:56:11 2024 @@ -1,8 +1,10 @@ -/* $NetBSD: float.h,v 1.8 2011/07/11 02:54:04 matt Exp $ */ +/* $NetBSD: float.h,v 1.9 2024/10/30 15:56:11 riastradh Exp $ */ #ifndef _HPPA_FLOAT_H_ #define _HPPA_FLOAT_H_ +#include <sys/featuretest.h> + #ifdef _LP64 #ifdef __LDBL_MANT_DIG__ #define LDBL_MANT_DIG __LDBL_MANT_DIG__ Index: src/sys/arch/ia64/include/fenv.h diff -u src/sys/arch/ia64/include/fenv.h:1.3 src/sys/arch/ia64/include/fenv.h:1.4 --- src/sys/arch/ia64/include/fenv.h:1.3 Sat Nov 16 22:51:51 2019 +++ src/sys/arch/ia64/include/fenv.h Wed Oct 30 15:56:11 2024 @@ -29,6 +29,7 @@ #ifndef _IA64_FENV_H_ #define _IA64_FENV_H_ +#include <sys/featuretest.h> #include <sys/stdint.h> #ifndef __fenv_static Index: src/sys/arch/ia64/include/limits.h diff -u src/sys/arch/ia64/include/limits.h:1.10 src/sys/arch/ia64/include/limits.h:1.11 --- src/sys/arch/ia64/include/limits.h:1.10 Sat Mar 16 21:50:47 2024 +++ src/sys/arch/ia64/include/limits.h Wed Oct 30 15:56:11 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: limits.h,v 1.10 2024/03/16 21:50:47 christos Exp $ */ +/* $NetBSD: limits.h,v 1.11 2024/10/30 15:56:11 riastradh Exp $ */ /* * Copyright (c) 1988 The Regents of the University of California. @@ -34,6 +34,8 @@ #ifndef _MACHINE_LIMITS_H_ #define _MACHINE_LIMITS_H_ +#include <sys/featuretest.h> + #define CHAR_BIT 8 /* number of bits in a char */ #define UCHAR_MAX 0xff /* max value for an unsigned char */ Index: src/sys/arch/m68k/include/fenv.h diff -u src/sys/arch/m68k/include/fenv.h:1.9 src/sys/arch/m68k/include/fenv.h:1.10 --- src/sys/arch/m68k/include/fenv.h:1.9 Tue Sep 26 12:46:30 2023 +++ src/sys/arch/m68k/include/fenv.h Wed Oct 30 15:56:11 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: fenv.h,v 1.9 2023/09/26 12:46:30 tsutsui Exp $ */ +/* $NetBSD: fenv.h,v 1.10 2024/10/30 15:56:11 riastradh Exp $ */ /*- * Copyright (c) 2015 The NetBSD Foundation, Inc. @@ -32,7 +32,9 @@ #ifndef _M68K_FENV_H_ #define _M68K_FENV_H_ +#include <sys/featuretest.h> #include <sys/stdint.h> + #include <m68k/float.h> #include <m68k/fpreg.h> Index: src/sys/arch/m68k/include/float.h diff -u src/sys/arch/m68k/include/float.h:1.23 src/sys/arch/m68k/include/float.h:1.24 --- src/sys/arch/m68k/include/float.h:1.23 Sat Jun 15 11:44:09 2024 +++ src/sys/arch/m68k/include/float.h Wed Oct 30 15:56:11 2024 @@ -1,8 +1,10 @@ -/* $NetBSD: float.h,v 1.23 2024/06/15 11:44:09 rillig Exp $ */ +/* $NetBSD: float.h,v 1.24 2024/10/30 15:56:11 riastradh Exp $ */ #ifndef _M68K_FLOAT_H_ #define _M68K_FLOAT_H_ +#include <sys/featuretest.h> + /* * LDBL_MIN is half the x86 LDBL_MIN, even though both are 12-byte * floats with the same base properties and both allegedly Index: src/sys/arch/mips/include/fenv.h diff -u src/sys/arch/mips/include/fenv.h:1.6 src/sys/arch/mips/include/fenv.h:1.7 --- src/sys/arch/mips/include/fenv.h:1.6 Sun Jul 26 08:08:41 2020 +++ src/sys/arch/mips/include/fenv.h Wed Oct 30 15:56:11 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: fenv.h,v 1.6 2020/07/26 08:08:41 simonb Exp $ */ +/* $NetBSD: fenv.h,v 1.7 2024/10/30 15:56:11 riastradh Exp $ */ /*- * Copyright (c) 2004-2005 David Schultz <d...@freebsd.org> @@ -31,6 +31,7 @@ #ifndef _MIPS_FENV_H_ #define _MIPS_FENV_H_ +#include <sys/featuretest.h> #include <sys/stdint.h> /* Exception flags */ Index: src/sys/arch/mips/include/float.h diff -u src/sys/arch/mips/include/float.h:1.19 src/sys/arch/mips/include/float.h:1.20 --- src/sys/arch/mips/include/float.h:1.19 Sat Apr 27 06:01:08 2024 +++ src/sys/arch/mips/include/float.h Wed Oct 30 15:56:11 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: float.h,v 1.19 2024/04/27 06:01:08 rillig Exp $ */ +/* $NetBSD: float.h,v 1.20 2024/10/30 15:56:11 riastradh Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -29,6 +29,7 @@ #define _MIPS_FLOAT_H_ #include <sys/cdefs.h> +#include <sys/featuretest.h> #if defined(__mips_n32) || defined(__mips_n64) Index: src/sys/arch/or1k/include/float.h diff -u src/sys/arch/or1k/include/float.h:1.1 src/sys/arch/or1k/include/float.h:1.2 --- src/sys/arch/or1k/include/float.h:1.1 Wed Sep 3 19:34:26 2014 +++ src/sys/arch/or1k/include/float.h Wed Oct 30 15:56:11 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: float.h,v 1.1 2014/09/03 19:34:26 matt Exp $ */ +/* $NetBSD: float.h,v 1.2 2024/10/30 15:56:11 riastradh Exp $ */ /*- * Copyright (c) 2014 The NetBSD Foundation, Inc. @@ -33,6 +33,7 @@ #define _OR1K_FLOAT_H_ #include <sys/cdefs.h> +#include <sys/featuretest.h> #define LDBL_MANT_DIG __LDBL_MANT_DIG__ #define LDBL_DIG __LDBL_DIG__ Index: src/sys/arch/powerpc/include/fenv.h diff -u src/sys/arch/powerpc/include/fenv.h:1.7 src/sys/arch/powerpc/include/fenv.h:1.8 --- src/sys/arch/powerpc/include/fenv.h:1.7 Tue Sep 13 01:22:12 2022 +++ src/sys/arch/powerpc/include/fenv.h Wed Oct 30 15:56:11 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: fenv.h,v 1.7 2022/09/13 01:22:12 rin Exp $ */ +/* $NetBSD: fenv.h,v 1.8 2024/10/30 15:56:11 riastradh Exp $ */ /*- * Copyright (c) 2004-2005 David Schultz <d...@freebsd.org> @@ -31,6 +31,7 @@ #ifndef _POWERPC_FENV_H_ #define _POWERPC_FENV_H_ +#include <sys/featuretest.h> #include <sys/stdint.h> /* Exception flags */ Index: src/sys/arch/riscv/include/float.h diff -u src/sys/arch/riscv/include/float.h:1.1 src/sys/arch/riscv/include/float.h:1.2 --- src/sys/arch/riscv/include/float.h:1.1 Fri Sep 19 17:36:26 2014 +++ src/sys/arch/riscv/include/float.h Wed Oct 30 15:56:11 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: float.h,v 1.1 2014/09/19 17:36:26 matt Exp $ */ +/* $NetBSD: float.h,v 1.2 2024/10/30 15:56:11 riastradh Exp $ */ /*- * Copyright (c) 2014 The NetBSD Foundation, Inc. @@ -33,6 +33,7 @@ #define _RISCV_FLOAT_H_ #include <sys/cdefs.h> +#include <sys/featuretest.h> #define LDBL_MANT_DIG __LDBL_MANT_DIG__ #define LDBL_DIG __LDBL_DIG__ Index: src/sys/arch/sh3/include/fenv.h diff -u src/sys/arch/sh3/include/fenv.h:1.3 src/sys/arch/sh3/include/fenv.h:1.4 --- src/sys/arch/sh3/include/fenv.h:1.3 Wed Mar 22 23:11:10 2017 +++ src/sys/arch/sh3/include/fenv.h Wed Oct 30 15:56:12 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: fenv.h,v 1.3 2017/03/22 23:11:10 chs Exp $ */ +/* $NetBSD: fenv.h,v 1.4 2024/10/30 15:56:12 riastradh Exp $ */ /*- * Copyright (c) 2016 The NetBSD Foundation, Inc. @@ -32,11 +32,13 @@ #ifndef _SH3_FENV_H_ #define _SH3_FENV_H_ +#include <sys/featuretest.h> #include <sys/stdint.h> + #include <sh3/float.h> #include <sh3/fpreg.h> -#ifndef __fenv_static +#ifndef __fenv_static #define __fenv_static static #endif Index: src/sys/arch/sparc/include/float.h diff -u src/sys/arch/sparc/include/float.h:1.12 src/sys/arch/sparc/include/float.h:1.13 --- src/sys/arch/sparc/include/float.h:1.12 Wed Nov 25 08:43:15 2009 +++ src/sys/arch/sparc/include/float.h Wed Oct 30 15:56:12 2024 @@ -1,8 +1,10 @@ -/* $NetBSD: float.h,v 1.12 2009/11/25 08:43:15 martin Exp $ */ +/* $NetBSD: float.h,v 1.13 2024/10/30 15:56:12 riastradh Exp $ */ #ifndef _SPARC_FLOAT_H_ #define _SPARC_FLOAT_H_ +#include <sys/featuretest.h> + #ifdef _LP64 #define LDBL_MANT_DIG 113 Index: src/sys/arch/vax/include/math.h diff -u src/sys/arch/vax/include/math.h:1.9 src/sys/arch/vax/include/math.h:1.10 --- src/sys/arch/vax/include/math.h:1.9 Tue Jan 24 17:50:18 2023 +++ src/sys/arch/vax/include/math.h Wed Oct 30 15:56:12 2024 @@ -1,9 +1,10 @@ -/* $NetBSD: math.h,v 1.9 2023/01/24 17:50:18 christos Exp $ */ +/* $NetBSD: math.h,v 1.10 2024/10/30 15:56:12 riastradh Exp $ */ #ifndef _VAX_MATH_H_ #define _VAX_MATH_H_ #include <sys/cdefs.h> +#include <sys/featuretest.h> #if __GNUC_PREREQ__(3, 3) #define __INFINITY __builtin_huge_valf() Index: src/sys/sys/common_limits.h diff -u src/sys/sys/common_limits.h:1.3 src/sys/sys/common_limits.h:1.4 --- src/sys/sys/common_limits.h:1.3 Mon Jan 21 20:29:27 2019 +++ src/sys/sys/common_limits.h Wed Oct 30 15:56:12 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: common_limits.h,v 1.3 2019/01/21 20:29:27 dholland Exp $ */ +/* $NetBSD: common_limits.h,v 1.4 2024/10/30 15:56:12 riastradh Exp $ */ /*- * Copyright (c) 2014 The NetBSD Foundation, Inc. @@ -32,6 +32,8 @@ #ifndef _SYS_COMMON_LIMITS_H_ #define _SYS_COMMON_LIMITS_H_ +#include <sys/featuretest.h> + #define CHAR_BIT __CHAR_BIT__ /* number of bits in a char */ #define SCHAR_MIN (-__SCHAR_MAX__-1) /* min value for a signed char */ Index: src/sys/sys/epoll.h diff -u src/sys/sys/epoll.h:1.2 src/sys/sys/epoll.h:1.3 --- src/sys/sys/epoll.h:1.2 Sun Jul 30 18:31:14 2023 +++ src/sys/sys/epoll.h Wed Oct 30 15:56:12 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: epoll.h,v 1.2 2023/07/30 18:31:14 christos Exp $ */ +/* $NetBSD: epoll.h,v 1.3 2024/10/30 15:56:12 riastradh Exp $ */ /*- * Copyright (c) 2007 Roman Divacky @@ -32,8 +32,10 @@ #define _SYS_EPOLL_H_ #include <sys/fcntl.h> /* for O_CLOEXEC */ -#include <sys/types.h> /* for uint32_t, uint64_t */ +#include <sys/featuretest.h> #include <sys/sigtypes.h> /* for sigset_t */ +#include <sys/types.h> /* for uint32_t, uint64_t */ + struct timespec; #define EPOLL_CLOEXEC O_CLOEXEC Index: src/sys/sys/ttycom.h diff -u src/sys/sys/ttycom.h:1.22 src/sys/sys/ttycom.h:1.23 --- src/sys/sys/ttycom.h:1.22 Wed Dec 21 19:08:22 2022 +++ src/sys/sys/ttycom.h Wed Oct 30 15:56:12 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: ttycom.h,v 1.22 2022/12/21 19:08:22 chs Exp $ */ +/* $NetBSD: ttycom.h,v 1.23 2024/10/30 15:56:12 riastradh Exp $ */ /*- * Copyright (c) 1982, 1986, 1990, 1993, 1994 @@ -59,6 +59,12 @@ struct winsize { }; #endif /* !_POSIX_SYS_TTYCOM_H_ */ +#include <sys/featuretest.h> + +/* + * XXX This is revolting -- should not depend on order of includes via + * _SYS_IOCTL_H_. + */ #if defined(_NETBSD_SOURCE) || defined(_SYS_IOCTL_H_) #ifndef _NETBSD_SYS_TTYCOM_H_