[PATCH] D79305: chrono: check _POSIX_TIMERS before using clock_gettime

Louis Dionne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 4 07:59:49 PDT 2020


ldionne added a comment.

LGTM generally speaking, but is this triggered by a specific failure you ran into? If so, on what configuration? We should have a way to test this change.

Also, next time, please include context in your Phabricator diff.



================
Comment at: libcxx/src/chrono.cpp:15
 
-#if !defined(__APPLE__)
+#if !defined(__APPLE__) && defined(_POSIX_TIMERS)
 #define _LIBCPP_USE_CLOCK_GETTIME
----------------
>From https://linux.die.net/man/3/clock_gettime, it says you need to include `<unistd.h>` to get the macro definition.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79305/new/

https://reviews.llvm.org/D79305





More information about the llvm-commits mailing list