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")
include_directories("${PROJECT_SOURCE_DIR}/lib/bullet/src")
if(WIN32)
if(WIN32 OR CMAKE_SYSTEM_NAME MATCHES "BSD")
set(LIBRESOLV_LIBRARY)
elseif (HAIKU)
find_library(LIBRESOLV_LIBRARY NAMES network socket)
else()
if (NOT CMAKE_SYSTEM_NAME MATCHES "BSD")
find_library(LIBRESOLV_LIBRARY NAMES resolv libresolv)
else()
set(LIBRESOLV_LIBRARY)
endif()
endif()
# 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.
if(USE_WIIUSE)
# 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)
endif()

View File

@ -1085,25 +1085,28 @@
// Haiku OS
#elif __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__)
#define AS_X86
#define THISCALL_PASS_OBJECT_POINTER_ON_THE_STACK
#define THISCALL_RETURN_SIMPLE_IN_MEMORY
#define CDECL_RETURN_SIMPLE_IN_MEMORY
#define STDCALL_RETURN_SIMPLE_IN_MEMORY
#elif defined(__x86_64__)
#define AS_X64_GCC
#define HAS_128_BIT_PRIMITIVES
#define SPLIT_OBJS_BY_MEMBER_TYPES
#undef COMPLEX_MASK
#define COMPLEX_MASK (asOBJ_APP_CLASS_DESTRUCTOR | asOBJ_APP_CLASS_COPY_CONSTRUCTOR | asOBJ_APP_ARRAY)
#undef COMPLEX_RETURN_MASK
#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
#define AS_POSIX_THREADS
#if !( ( (__GNUC__ == 4) && (__GNUC_MINOR__ >= 1) || __GNUC__ > 4) )
// Only with GCC 4.1 was the atomic instructions available
#define AS_NO_ATOMIC
#endif
// Illumos
#elif defined(__sun)
#if (defined(i386) || defined(__i386) || defined(__i386__)) && !defined(__LP64__)

View File

@ -22,6 +22,7 @@
//! _IRR_WINDOWS_CE_PLATFORM_ for Windows CE
//! _IRR_WINDOWS_API_ for Windows or XBox
//! _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_OSX_PLATFORM_ for Apple systems running OSX
//! _IRR_IOS_PLATFORM_ for Apple devices running iOS
@ -88,6 +89,15 @@
#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)
#define _IRR_ANDROID_PLATFORM_
#define _IRR_POSIX_API_
@ -99,7 +109,7 @@
#define _IRR_COMPILE_ANDROID_ASSET_READER_
#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_
#define _IRR_LINUX_PLATFORM_
#endif

View File

@ -874,7 +874,7 @@ IFileList* CFileSystem::createFileList(const io::path& directory)
size = buf.st_size;
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
else
{

View File

@ -11,7 +11,7 @@
#else
#include <string.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/types.h>
#if defined(ANDROID) || (defined(__linux__) && !defined(__GLIBC__))