Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NetBSD support #1247

Merged
merged 1 commit into from Jan 19, 2016
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions dmd2/root/port.c
Expand Up @@ -651,7 +651,7 @@ longdouble Port::strtold(const char *p, char **endp)

#endif

#if __linux__ || __APPLE__ || __FreeBSD__ || __OpenBSD__ || __DragonFly__ || __HAIKU__
#if __linux__ || __APPLE__ || __FreeBSD__ || __OpenBSD__ || __NetBSD__ || __DragonFly__ || __HAIKU__

#include <math.h>
#if __linux__
Expand Down Expand Up @@ -806,7 +806,7 @@ int Port::isNan(double r)
#else
return __inline_isnan(r);
#endif
#elif __HAIKU__ || __FreeBSD__ || __OpenBSD__ || __DragonFly__
#elif __HAIKU__ || __FreeBSD__ || __OpenBSD__ || __NetBSD__ || __DragonFly__
return isnan(r);
#else
#undef isnan
Expand All @@ -822,7 +822,7 @@ int Port::isNan(longdouble r)
#else
return __inline_isnan(r);
#endif
#elif __HAIKU__ || __FreeBSD__ || __OpenBSD__ || __DragonFly__
#elif __HAIKU__ || __FreeBSD__ || __OpenBSD__ || __NetBSD__ || __DragonFly__
return isnan(r);
#else
#undef isnan
Expand Down Expand Up @@ -850,7 +850,7 @@ int Port::isInfinity(double r)
{
#if __APPLE__
return fpclassify(r) == FP_INFINITE;
#elif __HAIKU__ || __FreeBSD__ || __OpenBSD__ || __DragonFly__
#elif __HAIKU__ || __FreeBSD__ || __OpenBSD__ || __NetBSD__ || __DragonFly__
return isinf(r);
#else
#undef isinf
Expand All @@ -865,7 +865,7 @@ longdouble Port::sqrt(longdouble x)

longdouble Port::fmodl(longdouble x, longdouble y)
{
#if __FreeBSD__ && __FreeBSD_version < 800000 || __OpenBSD__ || __DragonFly__
#if __FreeBSD__ && __FreeBSD_version < 800000 || __OpenBSD__ || __NetBSD__ || __DragonFly__
return ::fmod(x, y); // hack for now, fix later
#else
return ::fmodl(x, y);
Expand Down
1 change: 1 addition & 0 deletions driver/linker.cpp
Expand Up @@ -175,6 +175,7 @@ static int linkObjToBinaryGcc(bool sharedLib, bool fullyStatic) {
args.push_back("-ldl");
// fallthrough
case llvm::Triple::FreeBSD:
case llvm::Triple::NetBSD:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can merge this case with the FreeBSD case above.

addSoname = true;
args.push_back("-lpthread");
args.push_back("-lm");
Expand Down
4 changes: 4 additions & 0 deletions runtime/CMakeLists.txt
Expand Up @@ -83,6 +83,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_NETBSD ${RUNTIME_DIR}/src/core/sys/netbsd/*.d)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you planning on adding any NetBSD-specific declarations to this druntime directory? If not, better to leave this out until you need it.

Are you able to get ldc passing the druntime/phobos tests with only this patch to ldc? If not, you might want to get that working first, then finish this ldc PR after you're sure it's working.

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)
file(GLOB_RECURSE CORE_D_SOLARIS ${RUNTIME_DIR}/src/core/sys/solaris/*.d)
Expand All @@ -94,6 +95,9 @@ if(UNIX)
if(${CMAKE_SYSTEM} MATCHES "FreeBSD")
list(APPEND CORE_D_SYS ${CORE_D_FREEBSD})
endif()
if(${CMAKE_SYSTEM} MATCHES "NetBSD")
list(APPEND CORE_D_SYS ${CORE_D_NETBSD})
endif()
if(${CMAKE_SYSTEM} MATCHES "Linux")
list(APPEND CORE_D_SYS ${CORE_D_LINUX})
endif()
Expand Down