Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.
/ druntime Public archive
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
15 changes: 15 additions & 0 deletions src/core/stdc/config.d
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ version (StdDdoc)
alias ddoc_long = int;
alias ddoc_ulong = uint;
}
version (Posix)
alias ddoc_wchar_t = dchar;
else
alias ddoc_wchar_t = wchar;
}

/***
Expand Down Expand Up @@ -86,6 +90,12 @@ version (StdDdoc)
* C++ compiler's `ptrdiff_t` type.
*/
alias cpp_ptrdiff_t = ptrdiff_t;

/***
* Used for a character type that corresponds in size and mangling to the associated
* C++ compiler's `wchar_t` type.
*/
alias wchar_t = ddoc_wchar_t;
}
else
{
Expand All @@ -112,6 +122,9 @@ version (Windows)

alias long cpp_longlong;
alias ulong cpp_ulonglong;

enum __c_wchar_t : wchar;
alias wchar_t = __c_wchar_t;
}
else version (Posix)
{
Expand Down Expand Up @@ -143,6 +156,8 @@ else version (Posix)
alias long cpp_longlong;
alias ulong cpp_ulonglong;
}
enum __c_wchar_t : dchar;
alias wchar_t = __c_wchar_t;
}

version (CRuntime_Microsoft)
Expand Down
11 changes: 1 addition & 10 deletions src/core/stdc/stddef.d
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,4 @@ alias nullptr_t = typeof(null);

// size_t and ptrdiff_t are defined in the object module.

version (Windows)
{
///
alias wchar wchar_t;
}
else version (Posix)
{
///
alias dchar wchar_t;
}
public import core.stdc.config : wchar_t;
2 changes: 1 addition & 1 deletion src/core/stdc/wchar_.d
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ else
alias wchar_t wint_t;

///
enum wchar_t WEOF = 0xFFFF;
enum wchar_t WEOF = cast(wchar_t)0xFFFF;

///
int fwprintf(FILE* stream, in wchar_t* format, ...);
Expand Down
2 changes: 1 addition & 1 deletion src/rt/dmain2.d
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ extern (C) void _d_print_throwable(Throwable t)
len += written;
}

typeof(ptr) get() { if (ptr) ptr[len] = 0; return ptr; }
typeof(ptr) get() { if (ptr) ptr[len] = '\0'; return ptr; }

void free() { .free(ptr); }
}
Expand Down