mirror of https://github.com/OpenTTD/OpenTTD
Codechange: removed some left-behind __NDS__ references
parent
7784d77713
commit
ad30d04b5e
|
@ -25,24 +25,8 @@
|
||||||
*/
|
*/
|
||||||
template <typename T, size_t length>
|
template <typename T, size_t length>
|
||||||
struct SmallStackSafeStackAlloc {
|
struct SmallStackSafeStackAlloc {
|
||||||
#if !defined(__NDS__)
|
|
||||||
/** Storing the data on the stack */
|
/** Storing the data on the stack */
|
||||||
T data[length];
|
T data[length];
|
||||||
#else
|
|
||||||
/** Storing it on the heap */
|
|
||||||
T *data;
|
|
||||||
/** The length (in elements) of data in this allocator. */
|
|
||||||
size_t len;
|
|
||||||
|
|
||||||
/** Allocating the memory */
|
|
||||||
SmallStackSafeStackAlloc() : data(MallocT<T>(length)), len(length) {}
|
|
||||||
|
|
||||||
/** And freeing when it goes out of scope */
|
|
||||||
~SmallStackSafeStackAlloc()
|
|
||||||
{
|
|
||||||
free(data);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a pointer to the data stored in this wrapper.
|
* Gets a pointer to the data stored in this wrapper.
|
||||||
|
@ -69,11 +53,7 @@ struct SmallStackSafeStackAlloc {
|
||||||
*/
|
*/
|
||||||
inline T *EndOf()
|
inline T *EndOf()
|
||||||
{
|
{
|
||||||
#if !defined(__NDS__)
|
|
||||||
return endof(data);
|
return endof(data);
|
||||||
#else
|
|
||||||
return &data[len];
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -22,9 +22,6 @@
|
||||||
#define _GNU_SOURCE
|
#define _GNU_SOURCE
|
||||||
#define TROUBLED_INTS
|
#define TROUBLED_INTS
|
||||||
#include <strings.h>
|
#include <strings.h>
|
||||||
#elif defined(__NDS__)
|
|
||||||
#include <nds/jtypes.h>
|
|
||||||
#define TROUBLED_INTS
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* It seems that we need to include stdint.h before anything else
|
/* It seems that we need to include stdint.h before anything else
|
||||||
|
@ -433,7 +430,7 @@ void NORETURN CDECL error(const char *str, ...) WARN_FORMAT(1, 2);
|
||||||
#define OTTD_ASSERT
|
#define OTTD_ASSERT
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__NDS__) || defined(__DJGPP__)
|
#if defined(__DJGPP__)
|
||||||
/* DJGPP doesn't have C++ conformant _stricmp... */
|
/* DJGPP doesn't have C++ conformant _stricmp... */
|
||||||
#define _stricmp stricmp
|
#define _stricmp stricmp
|
||||||
#elif defined(OPENBSD)
|
#elif defined(OPENBSD)
|
||||||
|
|
Loading…
Reference in New Issue