Added support for Haiku operating system

* OpenGL and SDL2 are used
* Added Haiku platform in Irrlicht configurations
* Added support for Haiku in AngelScript
* Fixed multiple assertions
This commit is contained in:
Panagiotis Vasilopoulos 2020-06-14 21:41:38 +03:00
parent 4694223c03
commit d8709fde8f
No known key found for this signature in database
GPG Key ID: FD806FDB3B2C5270
5 changed files with 32 additions and 21 deletions

View File

@ -177,14 +177,12 @@ endif()
add_subdirectory("${PROJECT_SOURCE_DIR}/lib/bullet") add_subdirectory("${PROJECT_SOURCE_DIR}/lib/bullet")
include_directories("${PROJECT_SOURCE_DIR}/lib/bullet/src") include_directories("${PROJECT_SOURCE_DIR}/lib/bullet/src")
if(WIN32) if(WIN32 OR CMAKE_SYSTEM_NAME MATCHES "BSD")
set(LIBRESOLV_LIBRARY) set(LIBRESOLV_LIBRARY)
elseif (HAIKU)
find_library(LIBRESOLV_LIBRARY NAMES network socket)
else() else()
if (NOT CMAKE_SYSTEM_NAME MATCHES "BSD") find_library(LIBRESOLV_LIBRARY NAMES resolv libresolv)
find_library(LIBRESOLV_LIBRARY NAMES resolv libresolv)
else()
set(LIBRESOLV_LIBRARY)
endif()
endif() endif()
# Find system ENet library or build it if missing # Find system ENet library or build it if missing
@ -317,7 +315,7 @@ include_directories("${PROJECT_SOURCE_DIR}/lib/irrlicht/include")
# of the added include directory. # of the added include directory.
if(USE_WIIUSE) if(USE_WIIUSE)
# Find system WiiUse library or build it if missing # Find system WiiUse library or build it if missing
if((UNIX AND NOT APPLE) AND USE_SYSTEM_WIIUSE) if((UNIX AND NOT (APPLE OR HAIKU)) AND USE_SYSTEM_WIIUSE)
find_package(WiiUse) find_package(WiiUse)
endif() endif()

View File

@ -1085,23 +1085,26 @@
// Haiku OS // Haiku OS
#elif __HAIKU__ #elif __HAIKU__
#define AS_HAIKU #define AS_HAIKU
// Only x86-32 is currently supported by Haiku, but they do plan to support
// x86-64 and PowerPC in the future, so should go ahead and check the platform
// for future compatibility
#if (defined(i386) || defined(__i386) || defined(__i386__)) && !defined(__LP64__) #if (defined(i386) || defined(__i386) || defined(__i386__)) && !defined(__LP64__)
#define AS_X86 #define AS_X86
#define THISCALL_PASS_OBJECT_POINTER_ON_THE_STACK #define THISCALL_PASS_OBJECT_POINTER_ON_THE_STACK
#define THISCALL_RETURN_SIMPLE_IN_MEMORY #define THISCALL_RETURN_SIMPLE_IN_MEMORY
#define CDECL_RETURN_SIMPLE_IN_MEMORY #define CDECL_RETURN_SIMPLE_IN_MEMORY
#define STDCALL_RETURN_SIMPLE_IN_MEMORY #define STDCALL_RETURN_SIMPLE_IN_MEMORY
#else #elif defined(__x86_64__)
#define AS_MAX_PORTABILITY #define AS_X64_GCC
#endif #define HAS_128_BIT_PRIMITIVES
#define SPLIT_OBJS_BY_MEMBER_TYPES
#define AS_POSIX_THREADS #undef COMPLEX_MASK
#if !( ( (__GNUC__ == 4) && (__GNUC_MINOR__ >= 1) || __GNUC__ > 4) ) #define COMPLEX_MASK (asOBJ_APP_CLASS_DESTRUCTOR | asOBJ_APP_CLASS_COPY_CONSTRUCTOR | asOBJ_APP_ARRAY)
// Only with GCC 4.1 was the atomic instructions available #undef COMPLEX_RETURN_MASK
#define AS_NO_ATOMIC #define COMPLEX_RETURN_MASK (asOBJ_APP_CLASS_DESTRUCTOR | asOBJ_APP_CLASS_COPY_CONSTRUCTOR | asOBJ_APP_ARRAY)
#define AS_LARGE_OBJS_PASSED_BY_REF
#define AS_LARGE_OBJ_MIN_SIZE 5
#undef STDCALL
#define STDCALL
#else
#define AS_MAX_PORTABILITY
#endif #endif
// Illumos // Illumos

View File

@ -22,6 +22,7 @@
//! _IRR_WINDOWS_CE_PLATFORM_ for Windows CE //! _IRR_WINDOWS_CE_PLATFORM_ for Windows CE
//! _IRR_WINDOWS_API_ for Windows or XBox //! _IRR_WINDOWS_API_ for Windows or XBox
//! _IRR_LINUX_PLATFORM_ for Linux (it is defined here if no other os is defined) //! _IRR_LINUX_PLATFORM_ for Linux (it is defined here if no other os is defined)
//! _IRR_HAIKU_PLATFORM_ for Haiku
//! _IRR_SOLARIS_PLATFORM_ for Solaris //! _IRR_SOLARIS_PLATFORM_ for Solaris
//! _IRR_OSX_PLATFORM_ for Apple systems running OSX //! _IRR_OSX_PLATFORM_ for Apple systems running OSX
//! _IRR_IOS_PLATFORM_ for Apple devices running iOS //! _IRR_IOS_PLATFORM_ for Apple devices running iOS
@ -88,6 +89,15 @@
#endif #endif
#endif #endif
#if defined(HAIKU)
#define _IRR_HAIKU_PLATFORM_
#endif
#if defined(_IRR_HAIKU_PLATFORM_)
#define _IRR_COMPILE_WITH_SDL_DEVICE_
#define _IRR_COMPILE_WITH_OPENGL_
#endif
#if defined(ANDROID) #if defined(ANDROID)
#define _IRR_ANDROID_PLATFORM_ #define _IRR_ANDROID_PLATFORM_
#define _IRR_POSIX_API_ #define _IRR_POSIX_API_
@ -99,7 +109,7 @@
#define _IRR_COMPILE_ANDROID_ASSET_READER_ #define _IRR_COMPILE_ANDROID_ASSET_READER_
#endif #endif
#if !defined(_IRR_WINDOWS_API_) && !defined(_IRR_OSX_PLATFORM_) && !defined(_IRR_ANDROID_PLATFORM_) #if !defined(_IRR_WINDOWS_API_) && !defined(_IRR_OSX_PLATFORM_) && !defined(_IRR_ANDROID_PLATFORM_) && !defined(_IRR_HAIKU_PLATFORM_)
#ifndef _IRR_SOLARIS_PLATFORM_ #ifndef _IRR_SOLARIS_PLATFORM_
#define _IRR_LINUX_PLATFORM_ #define _IRR_LINUX_PLATFORM_
#endif #endif

View File

@ -874,7 +874,7 @@ IFileList* CFileSystem::createFileList(const io::path& directory)
size = buf.st_size; size = buf.st_size;
isDirectory = S_ISDIR(buf.st_mode); isDirectory = S_ISDIR(buf.st_mode);
} }
#if !defined(_IRR_SOLARIS_PLATFORM_) && !defined(__CYGWIN__) #if !defined(_IRR_SOLARIS_PLATFORM_) && !defined(__CYGWIN__) && !defined(__HAIKU__)
// only available on some systems // only available on some systems
else else
{ {

View File

@ -11,7 +11,7 @@
#else #else
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#if !defined(_IRR_SOLARIS_PLATFORM_) && !defined(__CYGWIN__) #if !defined(_IRR_SOLARIS_PLATFORM_) && !defined(__CYGWIN__) && !defined(__HAIKU__)
#include <sys/param.h> #include <sys/param.h>
#include <sys/types.h> #include <sys/types.h>
#if defined(ANDROID) || (defined(__linux__) && !defined(__GLIBC__)) #if defined(ANDROID) || (defined(__linux__) && !defined(__GLIBC__))