cwist
Modern C web framework with libttak runtime
Loading...
Searching...
No Matches
wasi.h
Go to the documentation of this file.
1
25#ifndef __CWIST_SYS_WASI_H__
26#define __CWIST_SYS_WASI_H__
27
28#if defined(__wasi__)
29/* Both preview1 and wasip2 ship a <sys/socket.h> file, but only wasip2's
30 * declares anything (wasi:sockets); preview1's is an empty placeholder.
31 * wasi-libc pairs the real socket surface with <netdb.h>, which preview1
32 * does not ship at all - use it as the discriminator. */
33#if defined(__has_include)
34#if __has_include(<netdb.h>)
35#define CWIST_WASI_SOCKETS 1
36#else
37#define CWIST_WASI_NO_SOCKETS 1
38#endif
39#else
40#define CWIST_WASI_NO_SOCKETS 1
41#endif
42#endif
43
44#endif /* __CWIST_SYS_WASI_H__ */