Skip to content

Commit 8036df3

Browse files
committed
dispatch: include time.h on windows
time.h is needed on Windows to ensure that we have a definition of `timespec`. This is needed when building the swift SDK overlay. It seems that when cross-compiling, we were getting lucky with the `timespec` definition being provided by some other header being included. This repairs the build of libdispatch's swift SDK overlay on Windows targeting Windows.
1 parent 5bcd598 commit 8036df3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

dispatch/dispatch.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@
4242
#include <unistd.h>
4343
#endif
4444
#include <fcntl.h>
45+
#if defined(_WIN32)
46+
#include <time.h>
47+
#endif
4548

4649
#if (defined(__linux__) || defined(__FreeBSD__)) && defined(__has_feature)
4750
#if __has_feature(modules)

0 commit comments

Comments
 (0)