Changeset - r23409:5566f342312d
[Not reviewed]
master
0 4 0
Patric Stout - 5 years ago 2019-03-04 19:51:46
truebrain@openttd.org
Fix: warnings when compiling for a recent version of Haiku

This might break older Haiku versions, but it is hard to tell.
4 files changed with 13 insertions and 12 deletions:
0 comments (0 inline, 0 general)
src/core/endian_type.hpp
Show inline comments
 
@@ -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>
src/dedicated.cpp
Show inline comments
 
@@ -22,10 +22,9 @@ FILE *_log_fd   = NULL; ///< File to rer
 

	
 
#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
src/network/core/os_abstraction.h
Show inline comments
 
@@ -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
src/stdafx.h
Show inline comments
 
@@ -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;
0 comments (0 inline, 0 general)