From 0b47ee21ea3f03466697df0dcd0ed3168f24772c Mon Sep 17 00:00:00 2001
From: begasus <begasus@gmail.com>
Date: Sat, 23 Mar 2019 13:23:30 +0100
Subject: fix undefined references to fopen64, ftello64 and fseeko64


diff --git a/src/libgame/zip/ioapi.h b/src/libgame/zip/ioapi.h
index 0741de4..1791243 100644
--- a/src/libgame/zip/ioapi.h
+++ b/src/libgame/zip/ioapi.h
@@ -33,7 +33,7 @@
 #  define ftello64 ftell
 #  define fseeko64 fseek
 #else
-#  if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__) || defined(__OpenBSD__) || defined(__APPLE__) || defined(__ANDROID__) || defined(__linux__)
+#  if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__) || defined(__OpenBSD__) || defined(__APPLE__) || defined(__ANDROID__) || defined(__linux__) || defined(__HAIKU__)
 #    define fopen64 fopen
 #    define ftello64 ftello
 #    define fseeko64 fseeko
-- 
2.26.0


From f4c180d791a648dbeaa2c99ea23b4532b4542145 Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Wed, 10 Jun 2020 08:49:55 +1000
Subject: Use realpath for argv[0]


diff --git a/src/main.c b/src/main.c
index 59faa00..23d34d0 100644
--- a/src/main.c
+++ b/src/main.c
@@ -7749,6 +7749,9 @@ static void InitProgramConfig(char *command_filename)
 
 int main(int argc, char *argv[])
 {
+#ifdef __HAIKU__
+  argv[0] = realpath(argv[0], NULL);
+#endif
   InitProgramConfig(argv[0]);
 
   InitWindowTitleFunction(getWindowTitleString);
-- 
2.26.0

