Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 Sep 2018 15:31:24 +0000 (UTC)
From:      Brooks Davis <brooks@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r338751 - head/include
Message-ID:  <201809181531.w8IFVOSW089586@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: brooks
Date: Tue Sep 18 15:31:24 2018
New Revision: 338751
URL: https://svnweb.freebsd.org/changeset/base/338751

Log:
  Fix C11 and POSIX 1003.1b-1993 compliance in time.h
  
  Only expose timespec_get in C11, C++17, or BSD code.  Always define
  struct timespect if defining timespec_get.
  
  PR:		231425
  Reviewed by:	kib
  Approved by:	re (gjb)
  Differential Revision:	https://reviews.freebsd.org/D17174

Modified:
  head/include/time.h

Modified: head/include/time.h
==============================================================================
--- head/include/time.h	Tue Sep 18 15:01:21 2018	(r338750)
+++ head/include/time.h	Tue Sep 18 15:31:24 2018	(r338751)
@@ -207,9 +207,13 @@ time_t posix2time(time_t t);
 #include <xlocale/_time.h>
 #endif
 
+#if defined(__BSD_VISIBLE) || __ISO_C_VISIBLE >= 2011 || \
+    (defined(cplusplus) && cplusplus >= 201703)
+#include <sys/_timespec.h>
 /* ISO/IEC 9899:201x 7.27.2.5 The timespec_get function */
 #define TIME_UTC	1	/* time elapsed since epoch */
 int timespec_get(struct timespec *ts, int base);
+#endif
 
 __END_DECLS
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201809181531.w8IFVOSW089586>