mirror of https://github.com/OpenTTD/OpenTTD.git
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:
parent
aa350528df
commit
1c5ea33099
|
@ -26,7 +26,7 @@
|
||||||
#define TTD_BIG_ENDIAN 1
|
#define TTD_BIG_ENDIAN 1
|
||||||
|
|
||||||
/* Windows has always LITTLE_ENDIAN */
|
/* Windows has always LITTLE_ENDIAN */
|
||||||
#if defined(_WIN32) || defined(__OS2__)
|
#if defined(_WIN32) || defined(__OS2__) || defined(__HAIKU__)
|
||||||
# define TTD_ENDIAN TTD_LITTLE_ENDIAN
|
# define TTD_ENDIAN TTD_LITTLE_ENDIAN
|
||||||
#elif defined(OSX)
|
#elif defined(OSX)
|
||||||
# include <sys/types.h>
|
# include <sys/types.h>
|
||||||
|
|
|
@ -22,10 +22,9 @@ FILE *_log_fd = NULL; ///< File to reroute output of a forked OpenTTD to
|
||||||
|
|
||||||
#include "safeguards.h"
|
#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
|
/* 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.
|
* 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"
|
# define PRINTF_PID_T "%ld"
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -63,7 +63,7 @@ typedef unsigned long in_addr_t;
|
||||||
# include <arpa/inet.h>
|
# include <arpa/inet.h>
|
||||||
# include <net/if.h>
|
# include <net/if.h>
|
||||||
/* According to glibc/NEWS, <ifaddrs.h> appeared in glibc-2.3. */
|
/* 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)
|
&& !(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
|
/* 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
|
* 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>
|
# include <netdb.h>
|
||||||
#endif /* UNIX */
|
#endif /* UNIX */
|
||||||
|
|
||||||
#ifdef __HAIKU__
|
|
||||||
#define IPV6_V6ONLY 27
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* OS/2 stuff */
|
/* OS/2 stuff */
|
||||||
#if defined(__OS2__)
|
#if defined(__OS2__)
|
||||||
# define SOCKET int
|
# define SOCKET int
|
||||||
|
|
14
src/stdafx.h
14
src/stdafx.h
|
@ -309,12 +309,18 @@ typedef unsigned char byte;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(TROUBLED_INTS)
|
#if defined(TROUBLED_INTS)
|
||||||
/* Haiku's types for uint32/int32 are based on longs, which causes
|
/* Haiku's types for uint32/int32/uint64/int64 are different than what
|
||||||
* trouble all over the place in OpenTTD. */
|
* they are on other platforms; not in length, but how to print them.
|
||||||
#define uint32 uint32_ugly_hack
|
* So make them more like the other platforms, to make printf() etc a
|
||||||
#define int32 int32_ugly_hack
|
* 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 unsigned int uint32_ugly_hack;
|
||||||
typedef signed int int32_ugly_hack;
|
typedef signed int int32_ugly_hack;
|
||||||
|
typedef unsigned __int64 uint64_ugly_hack;
|
||||||
|
typedef signed __int64 int64_ugly_hack;
|
||||||
#else
|
#else
|
||||||
typedef unsigned char uint8;
|
typedef unsigned char uint8;
|
||||||
typedef signed char int8;
|
typedef signed char int8;
|
||||||
|
|
Loading…
Reference in New Issue