qt: Add support for Haiku

* OpenAL backend is enabled by default on Haiku
* bswap include now makes use of builtins if they exist
* Use a local fgetws method for Haiku to avoid crashes
* OpenGL renderers are completely disabled on Haiku (they do not work)
* Software renderer is a widget, not a window on Haiku (fixes blank screen)
* Add option to disable System MIDI at compile time
This commit is contained in:
Cacodemon345
2022-03-11 12:03:54 +06:00
parent 1791ccdeb6
commit c1f9d35de8
17 changed files with 337 additions and 33 deletions

View File

@@ -21,7 +21,7 @@
#include "codegen_ops.h"
#include "codegen_ops_x86-64.h"
#if defined(__unix__) || defined(__APPLE__)
#if defined(__unix__) || defined(__APPLE__) || defined(__HAIKU__)
#include <sys/mman.h>
#include <unistd.h>
#endif
@@ -66,7 +66,7 @@ void codegen_init()
#if _WIN64
codeblock = VirtualAlloc(NULL, BLOCK_SIZE * sizeof(codeblock_t), MEM_COMMIT, PAGE_EXECUTE_READWRITE);
#elif defined(__unix__) || defined(__APPLE__)
#elif defined(__unix__) || defined(__APPLE__) || defined(__HAIKU__)
codeblock = mmap(NULL, BLOCK_SIZE * sizeof(codeblock_t), PROT_READ | PROT_WRITE | PROT_EXEC, MAP_ANON | MAP_PRIVATE, -1, 0);
#else
codeblock = malloc(BLOCK_SIZE * sizeof(codeblock_t));