From 9c0f0fe6ca592cb70e959790d339e0a1ac2735b6 Mon Sep 17 00:00:00 2001 From: Diederik de Groot Date: Thu, 21 Dec 2017 17:57:50 +0100 Subject: [PATCH 1/2] Add DragonFly support to ldc --- Makefile | 2 +- runnable/dhry.d | 11 +++++++++++ runnable/extra-files/cppb.cpp | 6 +++--- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 86975d451..85a62f4be 100644 --- a/Makefile +++ b/Makefile @@ -81,7 +81,7 @@ include ../src/osmodel.mak export OS -ifeq (freebsd,$(OS)) +ifeq ($(findstring bsd,$(OS)),bsd) SHELL=/usr/local/bin/bash else SHELL=/bin/bash diff --git a/runnable/dhry.d b/runnable/dhry.d index 8f98f7626..05948805f 100644 --- a/runnable/dhry.d +++ b/runnable/dhry.d @@ -909,3 +909,14 @@ version (OSX) // supplied by Anders F Bjorklund } } +version (DragonFlyBSD) +{ + import core.stdc.time; + + double dtime() + { + double q; + q = cast(double)time(null); + return q; + } +} diff --git a/runnable/extra-files/cppb.cpp b/runnable/extra-files/cppb.cpp index ed677edd5..dd508277f 100644 --- a/runnable/extra-files/cppb.cpp +++ b/runnable/extra-files/cppb.cpp @@ -345,7 +345,7 @@ size_t getoffset13161a() /****************************************************/ -#if __linux__ || __APPLE__ || __FreeBSD__ +#if __linux__ || __APPLE__ || __FreeBSD__ || __DragonFly__ #include #include #include @@ -402,7 +402,7 @@ wchar_t f13289_cpp_wchar_t(wchar_t ch) } } -#if __linux__ || __APPLE__ || __FreeBSD__ || __OpenBSD__ || __sun +#if __linux__ || __APPLE__ || __FreeBSD__ || __OpenBSD__ || __DragonFly__ || __sun unsigned short f13289_d_wchar(unsigned short ch); wchar_t f13289_d_dchar(wchar_t ch); #elif _WIN32 @@ -412,7 +412,7 @@ unsigned int f13289_d_dchar(unsigned int ch); bool f13289_cpp_test() { -#if __linux__ || __APPLE__ || __FreeBSD__ || __OpenBSD__ || __sun +#if __linux__ || __APPLE__ || __FreeBSD__ || __OpenBSD__ || __DragonFly__ || __sun if (!(f13289_d_wchar((unsigned short)'c') == (unsigned short)'C')) return false; if (!(f13289_d_wchar((unsigned short)'D') == (unsigned short)'D')) return false; if (!(f13289_d_dchar(L'e') == L'E')) return false; From b85d5d7ce6f9ea0a84ccfd175945da34faf1e116 Mon Sep 17 00:00:00 2001 From: Diederik de Groot Date: Wed, 7 Mar 2018 12:31:20 +0100 Subject: [PATCH 2/2] Match changes to Upstream dlang/dmd testsuite --- Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 85a62f4be..8d3689692 100644 --- a/Makefile +++ b/Makefile @@ -81,7 +81,11 @@ include ../src/osmodel.mak export OS -ifeq ($(findstring bsd,$(OS)),bsd) +ifeq (freebsd,$(OS)) + SHELL=/usr/local/bin/bash +else ifeq (netbsd,$(OS)) + SHELL=/usr/pkg/bin/bash +else ifeq (dragonflybsd,$(OS)) SHELL=/usr/local/bin/bash else SHELL=/bin/bash