Skip to content

Commit

Permalink
Correctly check for C++17 and higher when declaring timespec_get()
Browse files Browse the repository at this point in the history
Summary:
In rS338751, the check to declare `timespec_get()` for C++17 and higher
was incorrectly done against a `cplusplus` define, while it should have
been `__cplusplus`.

Fix this by using `__cplusplus`, and also bump `__FreeBSD_version` so it
becomes possible to correctly check for `timespec_get()` in upstream
libc++ headers.

Reviewed by:	brooks, emaste
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D22735
  • Loading branch information
DimitryAndric committed Dec 9, 2019
1 parent d8010b1 commit bc053ca
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/time.h
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ time_t posix2time(time_t t);
#endif

#if defined(__BSD_VISIBLE) || __ISO_C_VISIBLE >= 2011 || \
(defined(cplusplus) && cplusplus >= 201703)
(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 */
Expand Down
2 changes: 1 addition & 1 deletion sys/sys/param.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
* in the range 5 to 9.
*/
#undef __FreeBSD_version
#define __FreeBSD_version 1300063 /* Master, propagated to newvers */
#define __FreeBSD_version 1300064 /* Master, propagated to newvers */

/*
* __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
Expand Down

0 comments on commit bc053ca

Please sign in to comment.