Skip to content
Merged
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/etc/c/zlib/*.obj
/etc/c/zlib/*.o
/etc/c/zlib/zlib.lib
/etc/c/zlib/zlib.a
/phobos.json
/phobos.lib

Expand All @@ -14,3 +16,4 @@ Makefile
bin/
obj/
*.html

9 changes: 5 additions & 4 deletions std/datetime.d
Original file line number Diff line number Diff line change
Expand Up @@ -26530,10 +26530,11 @@ auto tz = TimeZone.getTimeZone("America/Los_Angeles");

version(Posix)
{
version(FreeBSD) enum utcZone = "Etc/UTC";
else version(linux) enum utcZone = "UTC";
else version(OSX) enum utcZone = "UTC";
else static assert(0, "The location of the UTC timezone file on this Posix platform must be set.");
version(FreeBSD) enum utcZone = "Etc/UTC";
else version(DragonFlyBSD) enum utcZone = "UTC";
else version(linux) enum utcZone = "UTC";
else version(OSX) enum utcZone = "UTC";
else static assert(0, "The location of the UTC timezone file on this Posix platform must be set.");

auto tzs = [testTZ("America/Los_Angeles", "PST", "PDT", dur!"hours"(-8), dur!"hours"(1)),
testTZ("America/New_York", "EST", "EDT", dur!"hours"(-5), dur!"hours"(1)),
Expand Down
4 changes: 4 additions & 0 deletions std/file.d
Original file line number Diff line number Diff line change
Expand Up @@ -1895,6 +1895,10 @@ else version (FreeBSD)

return buffer.assumeUnique;
}
else version (DragonFlyBSD)
{
return readLink("/proc/curproc/file");
}
else version (Solaris)
{
import core.sys.posix.unistd : getpid;
Expand Down
9 changes: 7 additions & 2 deletions std/internal/math/gammafunction.d
Original file line number Diff line number Diff line change
Expand Up @@ -537,8 +537,13 @@ unittest {
assert( feqrel(log(fabs(gamma(testpoints[i]))), testpoints[i+1]) > real.mant_dig-5);
}
}
assert(logGamma(-50.2) == log(fabs(gamma(-50.2))));
assert(logGamma(-0.008) == log(fabs(gamma(-0.008))));
version (DragonFlyBSD) { // FIXME: DragonFlyBSD: rounding differences between logGamma() and log() (ie:llvm_log())
assert(feqrel(logGamma(-50.2),log(fabs(gamma(-50.2)))) > real.mant_dig-2);
assert(feqrel(logGamma(-0.008),log(fabs(gamma(-0.008)))) > real.mant_dig-2);
} else {
assert(logGamma(-50.2) == log(fabs(gamma(-50.2))));
assert(logGamma(-0.008) == log(fabs(gamma(-0.008))));
}
assert(feqrel(logGamma(-38.8),log(fabs(gamma(-38.8)))) > real.mant_dig-4);
static if (real.mant_dig >= 64) // incl. 80-bit reals
assert(feqrel(logGamma(1500.0L),log(gamma(1500.0L))) > real.mant_dig-2);
Expand Down
28 changes: 28 additions & 0 deletions std/math.d
Original file line number Diff line number Diff line change
Expand Up @@ -7418,6 +7418,34 @@ private real polyImpl(real x, in real[] A) @trusted pure nothrow @nogc
;
}
}
else version (DragonFlyBSD)
{
asm pure nothrow @nogc // assembler by W. Bright
{
// EDX = (A.length - 1) * real.sizeof
mov ECX,A[EBP] ; // ECX = A.length
dec ECX ;
lea EDX,[ECX*8] ;
lea EDX,[EDX][ECX*4] ;
add EDX,A+4[EBP] ;
fld real ptr [EDX] ; // ST0 = coeff[ECX]
jecxz return_ST ;
fld x[EBP] ; // ST0 = x
fxch ST(1) ; // ST1 = x, ST0 = r
align 4 ;
L2: fmul ST,ST(1) ; // r *= x
fld real ptr -12[EDX] ;
sub EDX,12 ; // deg--
faddp ST(1),ST ;
dec ECX ;
jne L2 ;
fxch ST(1) ; // ST1 = r, ST0 = x
fstp ST(0) ; // dump x
align 4 ;
return_ST: ;
;
}
}
else
{
static assert(0);
Expand Down
8 changes: 8 additions & 0 deletions std/parallelism.d
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ else version(FreeBSD)
{
version = useSysctlbyname;
}
else version(DragonFlyBSD)
{
version = useSysctlbyname;
}

version(Windows)
{
Expand Down Expand Up @@ -172,6 +176,10 @@ else version(useSysctlbyname)
{
auto nameStr = "hw.ncpu\0".ptr;
}
else version(DragonFlyBSD)
{
auto nameStr = "hw.ncpu\0".ptr;
}

uint ans;
size_t len = uint.sizeof;
Expand Down
8 changes: 8 additions & 0 deletions std/socket.d
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,14 @@ string formatSocketError(int err) @trusted
else
return "Socket error " ~ to!string(err);
}
else version (DragonFlyBSD)
{
auto errs = strerror_r(err, buf.ptr, buf.length);
if (errs == 0)
cs = buf.ptr;
else
return "Socket error " ~ to!string(err);
}
else version (Solaris)
{
auto errs = strerror_r(err, buf.ptr, buf.length);
Expand Down
6 changes: 6 additions & 0 deletions std/stdio.d
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ version (FreeBSD)
version = HAS_GETDELIM;
}

version (DragonFlyBSD)
{
version = GENERIC_IO;
version = HAS_GETDELIM;
}

version (Solaris)
{
version = GENERIC_IO;
Expand Down
18 changes: 10 additions & 8 deletions std/system.d
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,15 @@ immutable
+/
enum OS
{
win32 = 1, /// Microsoft 32 bit Windows systems
win64, /// Microsoft 64 bit Windows systems
linux, /// All Linux Systems
osx, /// Mac OS X
freeBSD, /// FreeBSD
solaris, /// Solaris
android, /// Android
otherPosix /// Other Posix Systems
win32 = 1, /// Microsoft 32 bit Windows systems
win64, /// Microsoft 64 bit Windows systems
linux, /// All Linux Systems
osx, /// Mac OS X
freeBSD, /// FreeBSD
dragonFlyBSD, /// DragonFlyBSD
solaris, /// Solaris
android, /// Android
otherPosix /// Other Posix Systems
}

/// The OS that the program was compiled for.
Expand All @@ -46,6 +47,7 @@ immutable
else version(linux) OS os = OS.linux;
else version(OSX) OS os = OS.osx;
else version(FreeBSD) OS os = OS.freeBSD;
else version(DragonFlyBSD) OS os = OS.dragonFlyBSD;
else version(Posix) OS os = OS.otherPosix;
else static assert(0, "Unknown OS.");

Expand Down