Skip to content

Commit

Permalink
DragonFly BSD is somewhat identical to FreeBSD (minetest#8159)
Browse files Browse the repository at this point in the history
  • Loading branch information
Leonid Bobrov authored and luk3yx committed Feb 5, 2019
1 parent 4f90600 commit c226e15
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion cmake/Modules/FindGettextLib.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ find_package_handle_standard_args(GetText DEFAULT_MSG ${GETTEXT_REQUIRED_VARS})

if(GETTEXT_FOUND)
# BSD variants require special linkage as they don't use glibc
if(${CMAKE_SYSTEM_NAME} MATCHES "BSD")
if(${CMAKE_SYSTEM_NAME} MATCHES "BSD|DragonFly")
set(GETTEXT_LIBRARY "intl")
endif()

Expand Down
4 changes: 2 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -757,11 +757,11 @@ else()
endif()

set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG ${RELEASE_WARNING_FLAGS} ${WARNING_FLAGS} ${OTHER_FLAGS} -Wall -pipe -funroll-loops")
if(CMAKE_SYSTEM_NAME MATCHES "(Darwin|FreeBSD)")
if(CMAKE_SYSTEM_NAME MATCHES "(Darwin|BSD|DragonFly)")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Os")
else()
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -ffast-math -fomit-frame-pointer")
endif(CMAKE_SYSTEM_NAME MATCHES "(Darwin|FreeBSD)")
endif(CMAKE_SYSTEM_NAME MATCHES "(Darwin|BSD|DragonFly)")
set(CMAKE_CXX_FLAGS_SEMIDEBUG "-g -O1 -Wall -Wabi ${WARNING_FLAGS} ${OTHER_FLAGS}")
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -Wall -Wabi ${WARNING_FLAGS} ${OTHER_FLAGS}")

Expand Down
2 changes: 1 addition & 1 deletion src/cguittfont/irrUString.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
#define __BIG_ENDIAN 1
#elif defined(__MACH__) && defined(__APPLE__)
#include <machine/endian.h>
#elif defined(__FreeBSD__)
#elif defined(__FreeBSD__) || defined(__DragonFly__)
#include <sys/endian.h>
#else
#include <endian.h>
Expand Down
2 changes: 1 addition & 1 deletion src/intlGUIEditBox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ bool intlGUIEditBox::OnEvent(const SEvent& event)
break;
case EET_KEY_INPUT_EVENT:
{
#if (defined(__linux__) || defined(__FreeBSD__))
#if (defined(__linux__) || defined(__FreeBSD__)) || defined(__DragonFly__)
// ################################################################
// ValkaTR:
// This part is the difference from the original intlGUIEditBox
Expand Down
11 changes: 7 additions & 4 deletions src/threading/thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ DEALINGS IN THE SOFTWARE.
// for setName
#if defined(__linux__)
#include <sys/prctl.h>
#elif defined(__FreeBSD__) || defined(__OpenBSD__)
#elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
#include <pthread_np.h>
#elif defined(_MSC_VER)
struct THREADNAME_INFO {
Expand Down Expand Up @@ -287,7 +287,7 @@ void Thread::setName(const std::string &name)
// distributions are still runing 2.11 and previous versions.
prctl(PR_SET_NAME, name.c_str());

#elif defined(__FreeBSD__) || defined(__OpenBSD__)
#elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)

pthread_set_name_np(pthread_self(), name.c_str());

Expand Down Expand Up @@ -382,7 +382,11 @@ bool Thread::bindToProcessor(unsigned int proc_number)

return SetThreadAffinityMask(getThreadHandle(), 1 << proc_number);

#elif __FreeBSD_version >= 702106 || defined(__linux__)
#elif __MINGW32__

return SetThreadAffinityMask(pthread_gethandle(getThreadHandle()), 1 << proc_number);

#elif __FreeBSD_version >= 702106 || defined(__linux__) || defined(__DragonFly__)

cpu_set_t cpuset;

Expand Down Expand Up @@ -446,4 +450,3 @@ bool Thread::setPriority(int prio)

#endif
}

2 changes: 1 addition & 1 deletion src/util/serialize.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#define __BIG_ENDIAN 1
#elif defined(__MACH__) && defined(__APPLE__)
#include <machine/endian.h>
#elif defined(__FreeBSD__)
#elif defined(__FreeBSD__) || defined(__DragonFly__)
#include <sys/endian.h>
#else
#include <endian.h>
Expand Down

0 comments on commit c226e15

Please sign in to comment.