summaryrefslogtreecommitdiff
path: root/src/stdafx.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-01-21 23:55:57 +0000
committerrubidium <rubidium@openttd.org>2008-01-21 23:55:57 +0000
commit9444eb4484e5691a52ddc458bd8b401c6e19571d (patch)
treef2a45cf20dfcc7b58fae03b2429086124f62fa39 /src/stdafx.h
parentca1b3e7b4eb236b5cb36bfe2f83f2e0b0b6e24fa (diff)
downloadopenttd-9444eb4484e5691a52ddc458bd8b401c6e19571d.tar.xz
(svn r11939) -Codechange: some type fixes and very initial steps into supporting NDS by default. Based on work by Dominik.
Diffstat (limited to 'src/stdafx.h')
-rw-r--r--src/stdafx.h24
1 files changed, 17 insertions, 7 deletions
diff --git a/src/stdafx.h b/src/stdafx.h
index 40e58cb8c..6ce5a0066 100644
--- a/src/stdafx.h
+++ b/src/stdafx.h
@@ -5,6 +5,16 @@
#ifndef STDAFX_H
#define STDAFX_H
+#if defined(__NDS__)
+ #include <nds/jtypes.h>
+ /* NDS' 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
+ typedef unsigned int uint32_ugly_hack;
+ typedef signed int int32_ugly_hack;
+#endif /* __NDS__ */
+
/* It seems that we need to include stdint.h before anything else
* We need INT64_MAX, which for most systems comes from stdint.h. However, MSVC
* does not have stdint.h and apparently neither does MorphOS, so define
@@ -249,7 +259,7 @@ typedef unsigned char byte;
typedef unsigned int uint;
#endif
-#if !defined(__BEOS__) /* Already defined on BEOS */
+#if !defined(__BEOS__) && !defined(__NDS__) /* Already defined on BEOS and NDS */
typedef unsigned char uint8;
typedef signed char int8;
typedef unsigned short uint16;
@@ -258,7 +268,7 @@ typedef unsigned char byte;
typedef signed int int32;
typedef unsigned __int64 uint64;
typedef signed __int64 int64;
-#endif
+#endif /* !__BEOS__ && !__NDS__ */
#if !defined(WITH_PERSONAL_DIR)
#define PERSONAL_DIR ""
@@ -301,18 +311,18 @@ assert_compile(sizeof(uint8) == 1);
#define NOT_REACHED() error("NOT_REACHED triggered at line %i of %s", __LINE__, __FILE__)
-#if defined(MORPHOS)
- /* MorphOS doesn't have C++ conformant _stricmp... */
+#if defined(MORPHOS) || defined(__NDS__)
+ /* MorphOS and NDS don't have C++ conformant _stricmp... */
#define _stricmp stricmp
#elif defined(OPENBSD)
/* OpenBSD uses strcasecmp(3) */
#define _stricmp strcasecmp
#endif
-#if !defined(MORPHOS) && !defined(OPENBSD)
- /* MorphOS & OpenBSD don't know wchars, the rest does :( */
+#if !defined(MORPHOS) && !defined(OPENBSD) && !defined(__NDS__)
+ /* NDS, MorphOS & OpenBSD don't know wchars, the rest does :( */
#define HAS_WCHAR
-#endif /* !defined(MORPHOS) && !defined(OPENBSD) */
+#endif /* !defined(MORPHOS) && !defined(OPENBSD) && !defined(__NDS__) */
#if !defined(MAX_PATH)
#define MAX_PATH 260