git: cd5a2e6b4369 - stable/14 - time.h: Fix visibility check for C11 and C23 features.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 07 Sep 2023 20:28:52 UTC
The branch stable/14 has been updated by des:
URL: https://cgit.FreeBSD.org/src/commit/?id=cd5a2e6b43695a20f1b61fa47626cb8102a7d081
commit cd5a2e6b43695a20f1b61fa47626cb8102a7d081
Author: Dag-Erling Smørgrav <des@FreeBSD.org>
AuthorDate: 2023-09-06 01:37:43 +0000
Commit: Dag-Erling Smørgrav <des@FreeBSD.org>
CommitDate: 2023-09-07 20:28:31 +0000
time.h: Fix visibility check for C11 and C23 features.
__BSD_VISIBLE is always defined; we need to check if it's true.
Fixes: d02489d11aed 9b5d724cad10
MFC after: 3 days
Reviewed by: brooks, imp
Differential Revision: https://reviews.freebsd.org/D41733
(cherry picked from commit 8091b82e291642f3034dc3fdc8689a4f4ba027da)
Approved by: re (gjb)
---
include/time.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/time.h b/include/time.h
index ef55577a2f84..ff858cc1f420 100644
--- a/include/time.h
+++ b/include/time.h
@@ -179,13 +179,13 @@ time_t posix2time(time_t t);
#include <xlocale/_time.h>
#endif
-#if defined(__BSD_VISIBLE) || __ISO_C_VISIBLE >= 2011 || \
+#if __BSD_VISIBLE || __ISO_C_VISIBLE >= 2011 || \
(defined(__cplusplus) && __cplusplus >= 201703)
#include <sys/_timespec.h>
/* ISO/IEC 9899:2011 7.27.2.5 The timespec_get function */
#define TIME_UTC 1 /* time elapsed since epoch */
int timespec_get(struct timespec *ts, int base);
-#if defined (__BSD_VISIBLE) || __ISO_C_VISIBLE >= 2023
+#if __BSD_VISIBLE || __ISO_C_VISIBLE >= 2023
/* ISO/IEC 9899:2024 7.29.1 Components of time */
#define TIME_MONOTONIC 2 /* monotonic time */
/* ISO/IEC 9899:2024 7.29.2.7 The timespec_getres function */