Merge pull request #6548 from joakim-noah/musl

Musl: last remaining tweaks
merged-on-behalf-of: Sebastian Wilzbach <sebi.wilzbach@gmail.com>
This commit is contained in:
The Dlang Bot 2018-06-07 13:09:49 +02:00 committed by GitHub
commit ae88e34272
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 4 deletions

View file

@ -781,7 +781,11 @@ public:
@safe unittest
{
assert(LocalTime().dstName !is null);
// tzname, called from dstName, isn't set by default for Musl.
version(CRuntime_Musl)
assert(LocalTime().dstName is null);
else
assert(LocalTime().dstName !is null);
version(Posix)
{

View file

@ -704,9 +704,12 @@ version(CRuntime_Musl)
// sbrk and brk are disabled in Musl:
// https://git.musl-libc.org/cgit/musl/commit/?id=7a995fe706e519a4f55399776ef0df9596101f93
// https://git.musl-libc.org/cgit/musl/commit/?id=863d628d93ea341b6a32661a1654320ce69f6a07
} else:
private extern(C) void* sbrk(long) nothrow @nogc;
private extern(C) int brk(shared void*) nothrow @nogc;
}
else
{
private extern(C) void* sbrk(long) nothrow @nogc;
private extern(C) int brk(shared void*) nothrow @nogc;
}
/**
@ -718,6 +721,7 @@ that uncontrolled calls to `brk` and `sbrk` may affect the workings of $(D
SbrkRegion) adversely.
*/
version(CRuntime_Musl) {} else
version(Posix) struct SbrkRegion(uint minAlign = platformAlignment)
{
import core.sys.posix.pthread : pthread_mutex_init, pthread_mutex_destroy,
@ -898,6 +902,7 @@ version(Posix) struct SbrkRegion(uint minAlign = platformAlignment)
}
}
version(CRuntime_Musl) {} else
version(Posix) @system nothrow @nogc unittest
{
// Let's test the assumption that sbrk(n) returns the old address
@ -910,6 +915,7 @@ version(Posix) @system nothrow @nogc unittest
sbrk(-4096);
}
version(CRuntime_Musl) {} else
version(Posix) @system nothrow @nogc unittest
{
import std.typecons : Ternary;