From f1e94b259b4bd4fec195e9ab125a3bed14b1519d Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Fri, 11 Oct 2019 20:55:30 +1000
Subject: Fix build for Haiku


diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0ef2edd..5536b7f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -889,7 +889,7 @@ IF(DEFINED LIB_POSTFIX)
   SET(OSG_INSTALL_LIBDIR lib${LIB_POSTFIX})
 ELSE()
   IF(CMAKE_VERSION VERSION_LESS "2.8.5")
-    IF(UNIX AND NOT WIN32 AND NOT APPLE)
+    IF(UNIX AND NOT WIN32 AND NOT APPLE AND NOT HAIKU)
       IF(CMAKE_SIZEOF_VOID_P MATCHES "8")
         SET(LIB_POSTFIX "64" CACHE STRING "suffix for 32/64 dir placement")
         MARK_AS_ADVANCED(LIB_POSTFIX)
diff --git a/src/osgDB/FileUtils.cpp b/src/osgDB/FileUtils.cpp
index c0c8cec..5bf23b5 100644
--- a/src/osgDB/FileUtils.cpp
+++ b/src/osgDB/FileUtils.cpp
@@ -80,7 +80,7 @@ typedef char TCHAR;
     #if (MAC_OS_X_VERSION_MAX_ALLOWED <= 1040)
         #define stat64 stat
     #endif
-#elif defined(__CYGWIN__) || defined(__FreeBSD__) || defined(__DragonFly__) || \
+#elif defined(__CYGWIN__) || defined(__FreeBSD__) || defined(__HAIKU__) || defined(__DragonFly__) || \
       (defined(__hpux) && !defined(_LARGEFILE64_SOURCE))
     #define stat64 stat
 #endif
-- 
2.30.2


From 10aaa2c8fc959808770cbfbbd54995a9a4c545f4 Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Fri, 11 Oct 2019 20:55:47 +1000
Subject: Disable gpu stats


diff --git a/src/osgViewer/Renderer.cpp b/src/osgViewer/Renderer.cpp
index ab6e184..b3a89da 100644
--- a/src/osgViewer/Renderer.cpp
+++ b/src/osgViewer/Renderer.cpp
@@ -768,7 +768,11 @@ void Renderer::draw()
             state->getDynamicObjectRenderingCompletedCallback()->completed(state);
         }
 
+#ifndef __HAIKU__
         bool acquireGPUStats = stats && _querySupport && stats->collectStats("gpu");
+#else
+        bool acquireGPUStats = false;
+#endif
 
         if (acquireGPUStats)
         {
@@ -857,7 +861,12 @@ void Renderer::cull_draw()
         initialize(state);
     }
 
+#ifndef __HAIKU__
     bool acquireGPUStats = stats && _querySupport && stats->collectStats("gpu");
+#else
+    bool acquireGPUStats = false;
+#endif
+
 
     if (acquireGPUStats)
     {
-- 
2.30.2

