Fix: warnings when compiling for a recent version of Haiku

This might break older Haiku versions, but it is hard to tell.
This commit is contained in:
Patric Stout 2019-03-04 20:51:46 +01:00
parent aa350528df
commit 1c5ea33099
4 changed files with 13 additions and 12 deletions

View File

@ -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 <sys/types.h>

View File

@ -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

View File

@ -63,7 +63,7 @@ typedef unsigned long in_addr_t;
# include <arpa/inet.h>
# include <net/if.h>
/* According to glibc/NEWS, <ifaddrs.h> 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 <netdb.h>
#endif /* UNIX */
#ifdef __HAIKU__
#define IPV6_V6ONLY 27
#endif
/* OS/2 stuff */
#if defined(__OS2__)
# define SOCKET int

View File

@ -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;