From owner-svn-src-all@freebsd.org Tue Sep 18 15:31:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08EFE10A0FFF; Tue, 18 Sep 2018 15:31:25 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AE6D9752B3; Tue, 18 Sep 2018 15:31:24 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A97BA21CBA; Tue, 18 Sep 2018 15:31:24 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w8IFVOh9089587; Tue, 18 Sep 2018 15:31:24 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w8IFVOSW089586; Tue, 18 Sep 2018 15:31:24 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201809181531.w8IFVOSW089586@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Tue, 18 Sep 2018 15:31:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338751 - head/include X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/include X-SVN-Commit-Revision: 338751 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2018 15:31:25 -0000 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 #endif +#if defined(__BSD_VISIBLE) || __ISO_C_VISIBLE >= 2011 || \ + (defined(cplusplus) && cplusplus >= 201703) +#include /* 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