diff --git a/src/core/endian_type.hpp b/src/core/endian_type.hpp index 4058c5c19a..1cacf6c0cb 100644 --- a/src/core/endian_type.hpp +++ b/src/core/endian_type.hpp @@ -26,7 +26,7 @@ #define TTD_BIG_ENDIAN 1 /* Windows has always LITTLE_ENDIAN */ -#if defined(_WIN32) || defined(__OS2__) +#if defined(_WIN32) || defined(__OS2__) || defined(__HAIKU__) # define TTD_ENDIAN TTD_LITTLE_ENDIAN #elif defined(OSX) # include diff --git a/src/dedicated.cpp b/src/dedicated.cpp index e80abab164..574cbb0c34 100644 --- a/src/dedicated.cpp +++ b/src/dedicated.cpp @@ -22,10 +22,9 @@ FILE *_log_fd = NULL; ///< File to reroute output of a forked OpenTTD to #include "safeguards.h" -#if (defined(SUNOS) && !defined(_LP64) && !defined(_I32LPx)) || defined(__HAIKU__) +#if defined(SUNOS) && !defined(_LP64) && !defined(_I32LPx) /* Solaris has, in certain situation, pid_t defined as long, while in other * cases it has it defined as int... this handles all cases nicely. - * Haiku has also defined pid_t as a long. */ # define PRINTF_PID_T "%ld" #else diff --git a/src/network/core/os_abstraction.h b/src/network/core/os_abstraction.h index 084f763c2b..16c85d5660 100644 --- a/src/network/core/os_abstraction.h +++ b/src/network/core/os_abstraction.h @@ -63,7 +63,7 @@ typedef unsigned long in_addr_t; # include # include /* According to glibc/NEWS, appeared in glibc-2.3. */ -# if !defined(__sgi__) && !defined(SUNOS) && !defined(__HAIKU__) && !defined(__INNOTEK_LIBC__) \ +# if !defined(__sgi__) && !defined(SUNOS) && !defined(__INNOTEK_LIBC__) \ && !(defined(__GLIBC__) && (__GLIBC__ <= 2) && (__GLIBC_MINOR__ <= 2)) && !defined(__dietlibc__) && !defined(HPUX) /* If for any reason ifaddrs.h does not exist on your system, comment out * the following two lines and an alternative way will be used to fetch @@ -84,10 +84,6 @@ typedef unsigned long in_addr_t; # include #endif /* UNIX */ -#ifdef __HAIKU__ - #define IPV6_V6ONLY 27 -#endif - /* OS/2 stuff */ #if defined(__OS2__) # define SOCKET int diff --git a/src/stdafx.h b/src/stdafx.h index 1f1181b15e..98f5d13b91 100644 --- a/src/stdafx.h +++ b/src/stdafx.h @@ -309,12 +309,18 @@ typedef unsigned char byte; #endif #if defined(TROUBLED_INTS) - /* Haiku's types for uint32/int32 are based on longs, which causes - * trouble all over the place in OpenTTD. */ - #define uint32 uint32_ugly_hack - #define int32 int32_ugly_hack + /* Haiku's types for uint32/int32/uint64/int64 are different than what + * they are on other platforms; not in length, but how to print them. + * So make them more like the other platforms, to make printf() etc a + * little bit easier. */ +# define uint32 uint32_ugly_hack +# define int32 int32_ugly_hack +# define uint64 uint64_ugly_hack +# define int64 int64_ugly_hack typedef unsigned int uint32_ugly_hack; typedef signed int int32_ugly_hack; + typedef unsigned __int64 uint64_ugly_hack; + typedef signed __int64 int64_ugly_hack; #else typedef unsigned char uint8; typedef signed char int8;