src/stdafx.h
changeset 8869 1e62a45d7599
parent 8788 8e028dbff2e9
child 8905 a6974b6041d9
equal deleted inserted replaced
8868:822816ce1fcb 8869:1e62a45d7599
     2 
     2 
     3 /** @file stdafx.h */
     3 /** @file stdafx.h */
     4 
     4 
     5 #ifndef STDAFX_H
     5 #ifndef STDAFX_H
     6 #define STDAFX_H
     6 #define STDAFX_H
       
     7 
       
     8 #if defined(__NDS__)
       
     9 	#include <nds/jtypes.h>
       
    10 	/* NDS' types for uint32/int32 are based on longs, which causes
       
    11 	 * trouble all over the place in OpenTTD. */
       
    12 	#define uint32 uint32_ugly_hack
       
    13 	#define int32 int32_ugly_hack
       
    14 	typedef unsigned int uint32_ugly_hack;
       
    15 	typedef signed int int32_ugly_hack;
       
    16 #endif /* __NDS__ */
     7 
    17 
     8 /* It seems that we need to include stdint.h before anything else
    18 /* It seems that we need to include stdint.h before anything else
     9  * We need INT64_MAX, which for most systems comes from stdint.h. However, MSVC
    19  * We need INT64_MAX, which for most systems comes from stdint.h. However, MSVC
    10  * does not have stdint.h and apparently neither does MorphOS, so define
    20  * does not have stdint.h and apparently neither does MorphOS, so define
    11  * INT64_MAX for them ourselves.
    21  * INT64_MAX for them ourselves.
   247 /* This is already defined in unix, but not in QNX Neutrino (6.x)*/
   257 /* This is already defined in unix, but not in QNX Neutrino (6.x)*/
   248 #if (!defined(UNIX) && !defined(__CYGWIN__) && !defined(__BEOS__) && !defined(__MORPHOS__)) || defined(__QNXNTO__)
   258 #if (!defined(UNIX) && !defined(__CYGWIN__) && !defined(__BEOS__) && !defined(__MORPHOS__)) || defined(__QNXNTO__)
   249 	typedef unsigned int uint;
   259 	typedef unsigned int uint;
   250 #endif
   260 #endif
   251 
   261 
   252 #if !defined(__BEOS__) /* Already defined on BEOS */
   262 #if !defined(__BEOS__) && !defined(__NDS__) /* Already defined on BEOS and NDS */
   253 	typedef unsigned char    uint8;
   263 	typedef unsigned char    uint8;
   254 	typedef   signed char     int8;
   264 	typedef   signed char     int8;
   255 	typedef unsigned short   uint16;
   265 	typedef unsigned short   uint16;
   256 	typedef   signed short    int16;
   266 	typedef   signed short    int16;
   257 	typedef unsigned int     uint32;
   267 	typedef unsigned int     uint32;
   258 	typedef   signed int      int32;
   268 	typedef   signed int      int32;
   259 	typedef unsigned __int64 uint64;
   269 	typedef unsigned __int64 uint64;
   260 	typedef   signed __int64  int64;
   270 	typedef   signed __int64  int64;
   261 #endif
   271 #endif /* !__BEOS__ && !__NDS__ */
   262 
   272 
   263 #if !defined(WITH_PERSONAL_DIR)
   273 #if !defined(WITH_PERSONAL_DIR)
   264 	#define PERSONAL_DIR ""
   274 	#define PERSONAL_DIR ""
   265 #endif
   275 #endif
   266 
   276 
   299 	void CDECL error(const char *str, ...);
   309 	void CDECL error(const char *str, ...);
   300 #endif
   310 #endif
   301 
   311 
   302 #define NOT_REACHED() error("NOT_REACHED triggered at line %i of %s", __LINE__, __FILE__)
   312 #define NOT_REACHED() error("NOT_REACHED triggered at line %i of %s", __LINE__, __FILE__)
   303 
   313 
   304 #if defined(MORPHOS)
   314 #if defined(MORPHOS) || defined(__NDS__)
   305 	/* MorphOS doesn't have C++ conformant _stricmp... */
   315 	/* MorphOS and NDS don't have C++ conformant _stricmp... */
   306 	#define _stricmp stricmp
   316 	#define _stricmp stricmp
   307 #elif defined(OPENBSD)
   317 #elif defined(OPENBSD)
   308 	/* OpenBSD uses strcasecmp(3) */
   318 	/* OpenBSD uses strcasecmp(3) */
   309 	#define _stricmp strcasecmp
   319 	#define _stricmp strcasecmp
   310 #endif
   320 #endif
   311 
   321 
   312 #if !defined(MORPHOS) && !defined(OPENBSD)
   322 #if !defined(MORPHOS) && !defined(OPENBSD) && !defined(__NDS__)
   313 	/* MorphOS & OpenBSD don't know wchars, the rest does :( */
   323 	/* NDS, MorphOS & OpenBSD don't know wchars, the rest does :( */
   314 	#define HAS_WCHAR
   324 	#define HAS_WCHAR
   315 #endif /* !defined(MORPHOS) && !defined(OPENBSD) */
   325 #endif /* !defined(MORPHOS) && !defined(OPENBSD) && !defined(__NDS__) */
   316 
   326 
   317 #if !defined(MAX_PATH)
   327 #if !defined(MAX_PATH)
   318 	#define MAX_PATH 260
   328 	#define MAX_PATH 260
   319 #endif
   329 #endif
   320 
   330