DragonFly BSD is somewhat identical to FreeBSD (#8159)
authorLeonid Bobrov <mazocomp@disroot.org>
Sun, 3 Feb 2019 08:53:54 +0000 (10:53 +0200)
committerLoïc Blot <nerzhul@users.noreply.github.com>
Sun, 3 Feb 2019 08:53:54 +0000 (09:53 +0100)
cmake/Modules/FindGettextLib.cmake
src/CMakeLists.txt
src/gui/intlGUIEditBox.cpp
src/irrlicht_changes/irrUString.h
src/threading/thread.cpp
src/util/serialize.h

index cb1ce7b911f74724818fc4d58518c8b40a23f0d5..11de121770684973734e35babc2b017816854861 100644 (file)
@@ -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()
 
index 8218d586c85a27556279f4540d8fbc2d28301786..ee67a83e2d07e2ec616f3d42103705c969137e7c 100644 (file)
@@ -719,11 +719,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}")
 
index 6bbf74a7f4c4dca745f40bc04f62674a4a52aea7..fd3caa0f7be0d19669ab4c44117f20c3f00dc9df 100644 (file)
@@ -270,7 +270,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
index aead68babf522104a59993e9b02a48bb9913d6d2..fce49e7177d3397c1c47dbaaeb65e54a3cb05bbb 100644 (file)
@@ -48,7 +48,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>
index 3b6851389787d6fca35d32fd2deae14db204c3d7..e0f808c4da12472d52a791bb53f0d2f334203903 100644 (file)
@@ -31,7 +31,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 {
@@ -213,7 +213,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());
 
@@ -273,7 +273,7 @@ bool Thread::bindToProcessor(unsigned int proc_number)
 
        return SetThreadAffinityMask(pthread_gethandle(getThreadHandle()), 1 << proc_number);
 
-#elif __FreeBSD_version >= 702106 || defined(__linux__)
+#elif __FreeBSD_version >= 702106 || defined(__linux__) || defined(__DragonFly__)
 
        cpu_set_t cpuset;
 
index 5eb2b5f2e548d3f12ee0ada63ebde7357a3680a0..8ef0ad1c2c0b2602fd7d4a433750736c918f48b2 100644 (file)
@@ -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>