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
18 changes: 18 additions & 0 deletions src/core/sys/posix/inttypes.d
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,21 @@ intmax_t strtoimax(in char*, char**, int);
uintmax_t strtoumax(in char *, char**, int);
intmax_t wcstoimax(in wchar_t*, wchar_t**, int);
uintmax_t wcstoumax(in wchar_t*, wchar_t**, int);

version (Cpp98)
{
}
else
{
/* Add backwards compatibility overloads to the same functions for wchar* and dchar*.
* Being C with no name mangling, they'll resolve to the same functions.
*/
version (Windows)
private alias _old_wchar_t = wchar;
else version (Posix)
private alias _old_wchar_t = dchar;

intmax_t wcstoimax(in _old_wchar_t* nptr, _old_wchar_t** endptr, int base);
uintmax_t wcstoumax(in _old_wchar_t* nptr, _old_wchar_t** endptr, int base);
}

19 changes: 19 additions & 0 deletions src/core/sys/posix/stdlib.d
Original file line number Diff line number Diff line change
Expand Up @@ -678,3 +678,22 @@ else version (CRuntime_UClibc)
int mkstemp(char*);
}
}

version (Cpp98)
{
}
else
{
/* Add backwards compatibility overloads to the same functions for wchar* and dchar*.
* Being C with no name mangling, they'll resolve to the same functions.
*/
version (Windows)
private alias _old_wchar_t = wchar;
else version (Posix)
private alias _old_wchar_t = dchar;

int mbtowc(scope _old_wchar_t* pwc, scope const char* s, size_t n);
size_t mbstowcs(scope _old_wchar_t* pwcs, scope const char* s, size_t n);
size_t wcstombs(scope char* s, scope const _old_wchar_t* pwcs, size_t n);
}