Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify core.stdc.stdlib.d is missing some type definitions for wasm32-unknown-unknown-wasm target #4673 #16535

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions druntime/src/core/stdc/config.d
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,37 @@ version (Windows)
alias long cpp_longlong;
alias ulong cpp_ulonglong;
}
else version (WebAssembly)
{
static if ( (void*).sizeof > int.sizeof )
{
enum __c_longlong : long;
enum __c_ulonglong : ulong;

alias long c_long;
alias ulong c_ulong;

alias long cpp_long;
alias ulong cpp_ulong;

alias __c_longlong cpp_longlong;
alias __c_ulonglong cpp_ulonglong;
}
else
{
enum __c_long : int;
enum __c_ulong : uint;

alias int c_long;
alias uint c_ulong;

alias __c_long cpp_long;
alias __c_ulong cpp_ulong;

alias long cpp_longlong;
alias ulong cpp_ulonglong;
}
}
else version (Posix)
{
static if ( (void*).sizeof > int.sizeof )
Expand Down
5 changes: 5 additions & 0 deletions druntime/src/core/stdc/stddef.d
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ version (Windows)
///
alias wchar wchar_t;
}
else version (WebAssembly)
{
///
alias dchar wchar_t;
}
else version (Posix)
{
///
Expand Down
1 change: 1 addition & 0 deletions druntime/src/core/stdc/stdlib.d
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ else version (CRuntime_Musl) enum RAND_MAX = 0x7fffffff;
else version (CRuntime_Newlib) enum RAND_MAX = 0x7fffffff;
else version (CRuntime_UClibc) enum RAND_MAX = 0x7fffffff;
else version (WASI) enum RAND_MAX = 0x7fffffff;
else version (WebAssembly) enum RAND_MAX = 0x7fffffff;
else static assert( false, "Unsupported platform" );

///
Expand Down