From 106b3d010ce2961f876d09886ed5a6d394eb123a Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Fri, 1 Nov 2019 18:49:10 +1000
Subject: Fix build for Haiku


diff --git a/idlib/Str.cpp b/idlib/Str.cpp
index b37e1a9..db74996 100644
--- a/idlib/Str.cpp
+++ b/idlib/Str.cpp
@@ -224,7 +224,7 @@ int idStr::FindText( const char *str, const char *text, bool casesensitive, int
 			}
 		} else {
 			for ( j = 0; text[j]; j++ ) {
-				if ( ::toupper( str[i+j] ) != ::toupper( text[j] ) ) {
+				if ( toupper( str[i+j] ) != toupper( text[j] ) ) {
 					break;
 				}
 			}
@@ -302,7 +302,7 @@ bool idStr::Filter( const char *filter, const char *name, bool casesensitive ) {
 							}
 						}
 						else {
-							if ( ::toupper(*name) >= ::toupper(*filter) && ::toupper(*name) <= ::toupper(*(filter+2)) ) {
+							if ( toupper(*name) >= toupper(*filter) && toupper(*name) <= toupper(*(filter+2)) ) {
 								found = true;
 							}
 						}
@@ -315,7 +315,7 @@ bool idStr::Filter( const char *filter, const char *name, bool casesensitive ) {
 							}
 						}
 						else {
-							if ( ::toupper(*filter) == ::toupper(*name) ) {
+							if ( toupper(*filter) == toupper(*name) ) {
 								found = true;
 							}
 						}
@@ -342,7 +342,7 @@ bool idStr::Filter( const char *filter, const char *name, bool casesensitive ) {
 				}
 			}
 			else {
-				if ( ::toupper(*filter) != ::toupper(*name) ) {
+				if ( toupper(*filter) != toupper(*name) ) {
 					return false;
 				}
 			}
diff --git a/sys/platform.h b/sys/platform.h
index 2c4ce98..ef8e8a3 100644
--- a/sys/platform.h
+++ b/sys/platform.h
@@ -134,7 +134,7 @@ If you have questions concerning this license or the applicable additional terms
 
 
 // Unix
-#ifdef __unix__
+#if defined(__unix__) || defined(__HAIKU__)
 
 #define _alloca						alloca
 #define _alloca16( x )				((void *)((((uintptr_t)alloca( (x)+15 )) + 15) & ~15))
-- 
2.23.0

