Skip to content

Commit 620784a

Browse files
committed
fix WASI header includes
1 parent ed341dc commit 620784a

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

stdlib/public/runtime/Metadata.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@
4343
#else
4444
#include <sys/mman.h>
4545
#include <unistd.h>
46+
// WASI doesn't have dynamic linking yet
47+
#ifndef __wasi__
4648
#include <dlfcn.h>
49+
#endif //__wasi
4750
#endif
4851
#include "llvm/ADT/DenseMap.h"
4952
#include "llvm/ADT/Hashing.h"

stdlib/public/stubs/Stubs.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#define NOMINMAX
2727
#include <windows.h>
2828
#else
29-
#if !defined(__HAIKU__)
29+
#if !defined(__HAIKU__) && !defined(__wasi__)
3030
#include <sys/errno.h>
3131
#else
3232
#include <errno.h>
@@ -67,7 +67,7 @@ static float swift_strtof_l(const char *nptr, char **endptr, locale_t loc) {
6767
#define strtod_l swift_strtod_l
6868
#define strtof_l swift_strtof_l
6969
#endif
70-
#elif defined(__linux__)
70+
#elif defined(__linux__) || defined(__wasi__)
7171
#include <locale.h>
7272
#else
7373
#include <xlocale.h>

0 commit comments

Comments
 (0)