Skip to content

Commit 84763e7

Browse files
committed
update module to it compiles successfully on wasm
remove threading junk
1 parent 8fbbc43 commit 84763e7

5 files changed

Lines changed: 12 additions & 20 deletions

File tree

share/fast_io/fast_io.cppm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ export module fast_io;
2828
#ifndef FAST_IO_FREESTANDING
2929
#include "fast_io_inc/hosted.inc"
3030

31-
#include "fast_io_inc/host/posix.inc"
31+
#include "fast_io_inc/hosted/posix.inc"
3232

3333
#if defined(_WIN32) || defined(__CYGWIN__)
34-
#include "fast_io_inc/host/nt.inc"
35-
#include "fast_io_inc/host/win32.inc"
34+
#include "fast_io_inc/hosted/nt.inc"
35+
#include "fast_io_inc/hosted/win32.inc"
3636
#endif
3737

3838
#include "fast_io_inc/legacy/c.inc"

share/fast_io/fast_io_inc/hosted.inc

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -128,18 +128,6 @@ using ::fast_io::posix_clock_getres;
128128

129129
using ::fast_io::native_mutex;
130130

131-
using ::fast_io::native_socklen_t;
132-
133-
namespace this_thread
134-
{
135-
#if ((defined(_WIN32) && !defined(__WINE__)) && !defined(__CYGWIN__)) || (defined(__MSDOS__) || defined(__DJGPP__)) || defined(__wasi__) || (!defined(__SINGLE_THREAD__) && !defined(__NEWLIB__) && !defined(__MSDOS__) && __has_include(<pthread.h>))
136-
using ::fast_io::this_thread::get_id;
137-
using ::fast_io::this_thread::sleep_for;
138-
using ::fast_io::this_thread::sleep_until;
139-
using ::fast_io::this_thread::yield;
140-
#endif
141-
} // namespace this_thread
142-
143131
using ::fast_io::native_readlinkat;
144132
using ::fast_io::native_symlinkat;
145133
using ::fast_io::native_unlinkat;
@@ -150,10 +138,13 @@ using ::fast_io::native_at_flags;
150138
using ::fast_io::native_utimensat;
151139
using ::fast_io::native_linkat;
152140

141+
#ifndef __wasm__
142+
using ::fast_io::native_socklen_t;
153143
using ::fast_io::posix_accept;
154144
using ::fast_io::posix_connect;
155145
using ::fast_io::posix_bind;
156146
using ::fast_io::posix_listen;
147+
#endif
157148

158149
using ::fast_io::begin;
159150
using ::fast_io::end;
@@ -170,15 +161,17 @@ using ::fast_io::posix_file_status;
170161
using ::fast_io::truncate;
171162

172163
using ::fast_io::native_white_hole;
173-
using ::fast_io::native_socket_file;
174-
using ::fast_io::native_socket_io_observer;
175164

176165
using ::fast_io::ipv4;
177166
using ::fast_io::ipv6;
178167

168+
#ifndef __wasm__
169+
using ::fast_io::native_socket_file;
170+
using ::fast_io::native_socket_io_observer;
179171
using ::fast_io::native_dns_file;
180172
using ::fast_io::to_ip;
181173
using ::fast_io::to_ip_address;
174+
#endif
182175

183176
using ::fast_io::io_kernel;
184177

share/fast_io/fast_io_inc/host/posix.inc renamed to share/fast_io/fast_io_inc/hosted/posix.inc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export namespace fast_io
66
using ::fast_io::posix_stderr_number;
77
using ::fast_io::posix_domain_value;
88

9-
#if ((!defined(_WIN32) || defined(__WINE__)) || defined(__CYGWIN__))
9+
#if ((!defined(_WIN32) || defined(__WINE__)) || defined(__CYGWIN__)) && !defined(__wasm__)
1010
namespace posix
1111
{
1212
using ::fast_io::posix::libc_ioctl;
@@ -18,7 +18,6 @@ export namespace fast_io
1818
using ::fast_io::details::sys_mprotect;
1919
using ::fast_io::details::sys_munmap;
2020
using ::fast_io::details::sys_munmap_nothrow;
21-
2221
}
2322

2423
using ::fast_io::posix_socklen_t;

share/fast_io/fast_io_inc/host/win32.inc renamed to share/fast_io/fast_io_inc/hosted/win32.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,4 @@ export namespace fast_io
6161
using ::fast_io::data_sync_flags;
6262
using ::fast_io::data_sync;
6363
u using ::fast_io::flush;
64-
}
64+
}

0 commit comments

Comments
 (0)