[flang-commits] [flang] [flang][runtime] Implement SLEEP intrinsic (PR #79074)

Tom Eccles via flang-commits flang-commits at lists.llvm.org
Tue Jan 23 00:09:12 PST 2024


================
@@ -39,8 +40,10 @@ inline void CtimeBuffer(char *buffer, size_t bufsize, const time_t cur_time,
 #endif
 
 #if _REENTRANT || _POSIX_C_SOURCE >= 199506L
-// System is posix-compliant and has getlogin_r
+// System is posix-compliant and has getlogin_r and sleep
 #include <unistd.h>
+#elif _WIN32
+#include <windows.h> // for sleep
----------------
tblah wrote:

So far as I can tell, on my system (gnu libc++) `std::this_thread_sleep_for` is header-only. However, I haven't found any documentation indicating whether this is a safe assumption on other systems.

https://github.com/llvm/llvm-project/pull/79074


More information about the flang-commits mailing list