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
4 changes: 2 additions & 2 deletions dmd2/errors.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#endif
#endif

#if __linux__ || __APPLE__ || __FreeBSD__ || __OpenBSD__ || __sun
#if __linux__ || __APPLE__ || __FreeBSD__ || __OpenBSD__ || __DragonFly__ || __sun
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
Expand Down Expand Up @@ -64,7 +64,7 @@ bool isConsoleColorSupported()
{
#if _WIN32
return _isatty(_fileno(stderr)) != 0;
#elif __linux__ || __APPLE__ || __FreeBSD__ || __OpenBSD__ || __sun
#elif __linux__ || __APPLE__ || __FreeBSD__ || __OpenBSD__ || __DragonFly__ || __sun
const char *term = getenv("TERM");
return isatty(STDERR_FILENO) && term && term[0] && 0 != strcmp(term, "dumb");
#else
Expand Down
2 changes: 1 addition & 1 deletion dmd2/mars.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include <string>
#include <cstdarg>

#if __linux__ || __APPLE__ || __FreeBSD__ || __OpenBSD__ || __sun
#if __linux__ || __APPLE__ || __FreeBSD__ || __OpenBSD__ || __DragonFly__ || __sun
#include <errno.h>
#endif

Expand Down
14 changes: 10 additions & 4 deletions dmd2/root/port.c
Original file line number Diff line number Diff line change
Expand Up @@ -774,8 +774,10 @@ int Port::isNan(double r)
#else
return __inline_isnan(r);
#endif
#elif __HAIKU__ || __FreeBSD__ || __OpenBSD__ || __NetBSD__ || __DragonFly__
#elif __HAIKU__ || __FreeBSD__ || __OpenBSD__ || __NetBSD__
return isnan(r);
#elif__DragonFly__
return __isnand(r);
#else
#undef isnan
return std::isnan(r);
Expand All @@ -790,8 +792,10 @@ int Port::isNan(longdouble r)
#else
return __inline_isnan(r);
#endif
#elif __HAIKU__ || __FreeBSD__ || __OpenBSD__ || __NetBSD__ || __DragonFly__
#elif __HAIKU__ || __FreeBSD__ || __OpenBSD__ || __NetBSD__
return isnan(r);
#elif__DragonFly__
return __isnanl(r);
#else
#undef isnan
return std::isnan(r);
Expand All @@ -818,8 +822,10 @@ int Port::isInfinity(double r)
{
#if __APPLE__
return fpclassify(r) == FP_INFINITE;
#elif __HAIKU__ || __FreeBSD__ || __OpenBSD__ || __NetBSD__ || __DragonFly__
#elif __HAIKU__ || __FreeBSD__ || __OpenBSD__ || __NetBSD__
return isinf(r);
#elif__DragonFly__
return __isinfd(r);
#else
#undef isinf
return std::isinf(r);
Expand All @@ -833,7 +839,7 @@ longdouble Port::sqrt(longdouble x)

longdouble Port::fmodl(longdouble x, longdouble y)
{
#if __FreeBSD__ && __FreeBSD_version < 800000 || __OpenBSD__ || __NetBSD__ || __DragonFly__
#if __FreeBSD__ && __FreeBSD_version < 800000 || __OpenBSD__ || __NetBSD__
return ::fmod(x, y); // hack for now, fix later
#else
return std::fmod(x, y);
Expand Down
5 changes: 5 additions & 0 deletions runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ else()
endif()
file(GLOB_RECURSE CORE_D_UNIX ${RUNTIME_DIR}/src/core/sys/posix/*.d)
file(GLOB_RECURSE CORE_D_FREEBSD ${RUNTIME_DIR}/src/core/sys/freebsd/*.d)
file(GLOB_RECURSE CORE_D_DRAGONFLYBSD ${RUNTIME_DIR}/src/core/sys/dragonflybsd/*.d)
file(GLOB_RECURSE CORE_D_NETBSD ${RUNTIME_DIR}/src/core/sys/netbsd/*.d)
file(GLOB_RECURSE CORE_D_LINUX ${RUNTIME_DIR}/src/core/sys/linux/*.d)
file(GLOB_RECURSE CORE_D_OSX ${RUNTIME_DIR}/src/core/sys/osx/*.d)
Expand All @@ -100,6 +101,10 @@ if(UNIX)
if(${CMAKE_SYSTEM} MATCHES "NetBSD")
list(APPEND CORE_D_SYS ${CORE_D_NETBSD})
endif()
if(${CMAKE_SYSTEM_NAME} MATCHES "DragonFly")
message(WARNING, "Adding /src/core/sys/dragonflybsd/ ${CORE_D_DRAGONFLYBSD}")
list(APPEND CORE_D_SYS ${CORE_D_DRAGONFLYBSD})
endif()
if(${CMAKE_SYSTEM} MATCHES "Linux")
list(APPEND CORE_D_SYS ${CORE_D_LINUX})
endif()
Expand Down
3 changes: 2 additions & 1 deletion tests/d2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ if(${ptr_size} MATCHES "^4$")
elseif(${ptr_size} MATCHES "^8$")
set(host_model 64)
endif()
find_program (GNUMAKE NAMES gmake make)

function(add_testsuite config_name dflags model)
set(name dmd-testsuite${config_name})
Expand All @@ -17,7 +18,7 @@ function(add_testsuite config_name dflags model)
# testsuite build system provides no way to run the test cases with a
# given set of flags without trying all combinations of them.
add_test(NAME ${name}
COMMAND make -k -C ${PROJECT_SOURCE_DIR}/tests/d2/dmd-testsuite RESULTS_DIR=${outdir} DMD=$<TARGET_FILE:ldmd2> DFLAGS=${dflags} MODEL=${model} quick
COMMAND ${GNUMAKE} -k -C ${PROJECT_SOURCE_DIR}/tests/d2/dmd-testsuite RESULTS_DIR=${outdir} DMD=$<TARGET_FILE:ldmd2> DFLAGS=${dflags} MODEL=${model} quick
)
set_tests_properties(${name} PROPERTIES DEPENDS clean-${name})
endfunction()
Expand Down
3 changes: 3 additions & 0 deletions tests/d2/src/osmodel.mak
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ ifeq (,$(OS))
ifeq (OpenBSD,$(uname_S))
OS:=openbsd
endif
ifeq (DragonFly,$(uname_S))
OS:=dragonflybsd
endif
ifeq (Solaris,$(uname_S))
OS:=solaris
endif
Expand Down