Skip to content

Commit f09b16f

Browse files
joakim-noahtimotheecour
authored andcommitted
Add needed changes to get all tests passing with Musl
1 parent 4663709 commit f09b16f

File tree

3 files changed

+19
-55
lines changed

3 files changed

+19
-55
lines changed

std/experimental/allocator/building_blocks/region.d

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -647,6 +647,12 @@ struct InSituRegion(size_t size, size_t minAlign = platformAlignment)
647647
assert((() nothrow @nogc => r2.deallocateAll())());
648648
}
649649

650+
version(CRuntime_Musl)
651+
{
652+
// sbrk and brk are disabled in Musl:
653+
// https://git.musl-libc.org/cgit/musl/commit/?id=7a995fe706e519a4f55399776ef0df9596101f93
654+
// https://git.musl-libc.org/cgit/musl/commit/?id=863d628d93ea341b6a32661a1654320ce69f6a07
655+
} else:
650656
private extern(C) void* sbrk(long) nothrow @nogc;
651657
private extern(C) int brk(shared void*) nothrow @nogc;
652658

std/socket.d

Lines changed: 1 addition & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -163,56 +163,14 @@ string formatSocketError(int err) @trusted
163163
{
164164
cs = strerror_r(err, buf.ptr, buf.length);
165165
}
166-
else version (OSX)
167-
{
168-
auto errs = strerror_r(err, buf.ptr, buf.length);
169-
if (errs == 0)
170-
cs = buf.ptr;
171-
else
172-
return "Socket error " ~ to!string(err);
173-
}
174-
else version (FreeBSD)
175-
{
176-
auto errs = strerror_r(err, buf.ptr, buf.length);
177-
if (errs == 0)
178-
cs = buf.ptr;
179-
else
180-
return "Socket error " ~ to!string(err);
181-
}
182-
else version (NetBSD)
183-
{
184-
auto errs = strerror_r(err, buf.ptr, buf.length);
185-
if (errs == 0)
186-
cs = buf.ptr;
187-
else
188-
return "Socket error " ~ to!string(err);
189-
}
190-
else version (DragonFlyBSD)
191-
{
192-
auto errs = strerror_r(err, buf.ptr, buf.length);
193-
if (errs == 0)
194-
cs = buf.ptr;
195-
else
196-
return "Socket error " ~ to!string(err);
197-
}
198-
else version (Solaris)
199-
{
200-
auto errs = strerror_r(err, buf.ptr, buf.length);
201-
if (errs == 0)
202-
cs = buf.ptr;
203-
else
204-
return "Socket error " ~ to!string(err);
205-
}
206-
else version (CRuntime_Bionic)
166+
else
207167
{
208168
auto errs = strerror_r(err, buf.ptr, buf.length);
209169
if (errs == 0)
210170
cs = buf.ptr;
211171
else
212172
return "Socket error " ~ to!string(err);
213173
}
214-
else
215-
static assert(0);
216174

217175
auto len = strlen(cs);
218176

std/stdio.d

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -44,38 +44,38 @@ version (CRuntime_Glibc)
4444
version = GCC_IO;
4545
version = HAS_GETDELIM;
4646
}
47-
48-
version (OSX)
47+
else version (CRuntime_Bionic)
4948
{
5049
version = GENERIC_IO;
5150
version = HAS_GETDELIM;
5251
}
53-
54-
version (FreeBSD)
52+
else version (CRuntime_Musl)
5553
{
5654
version = GENERIC_IO;
5755
version = HAS_GETDELIM;
5856
}
5957

60-
version (NetBSD)
58+
version (OSX)
6159
{
6260
version = GENERIC_IO;
6361
version = HAS_GETDELIM;
6462
}
65-
66-
version (DragonFlyBSD)
63+
else version (FreeBSD)
6764
{
6865
version = GENERIC_IO;
6966
version = HAS_GETDELIM;
7067
}
71-
72-
version (Solaris)
68+
else version (NetBSD)
7369
{
7470
version = GENERIC_IO;
75-
version = NO_GETDELIM;
71+
version = HAS_GETDELIM;
7672
}
77-
78-
version (CRuntime_Bionic)
73+
else version (DragonFlyBSD)
74+
{
75+
version = GENERIC_IO;
76+
version = HAS_GETDELIM;
77+
}
78+
else version (Solaris)
7979
{
8080
version = GENERIC_IO;
8181
version = NO_GETDELIM;

0 commit comments

Comments
 (0)