mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-17 21:25:40 +00:00
(svn r1437) -Fix: Safetileadd preprocessor magic is the same as for GCC and no longer extern
This commit is contained in:
parent
b2063e2150
commit
528e6d973e
8
macros.h
8
macros.h
@ -81,16 +81,12 @@ enum {
|
|||||||
|
|
||||||
#define TILE_ASSERT(x) assert( TILE_MASK(x) == (x) );
|
#define TILE_ASSERT(x) assert( TILE_MASK(x) == (x) );
|
||||||
|
|
||||||
extern uint SafeTileAdd(uint x, int add, const char *exp, const char *file, int line);
|
uint SafeTileAdd(uint x, int add, const char *exp, const char *file, int line);
|
||||||
|
|
||||||
#if !defined(_DEBUG)
|
#if !defined(_DEBUG)
|
||||||
# define TILE_ADD(x,y) ((x)+(y))
|
# define TILE_ADD(x,y) ((x)+(y))
|
||||||
#else
|
#else
|
||||||
# if defined(__GNUC__)
|
# define TILE_ADD(x,y) (SafeTileAdd((x),(y), #x ", " #y, __FILE__, __LINE__))
|
||||||
# define TILE_ADD(x,y) (SafeTileAdd((x),(y), #x ", " #y, __FILE__, __LINE__))
|
|
||||||
# else
|
|
||||||
# define TILE_ADD(x,y) (SafeTileAdd((x),(y), #x ## ", " ## #y, __FILE__, __LINE__))
|
|
||||||
# endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define TILE_ADDXY(tile, x, y) TILE_ADD(tile, TILE_XY(x,y))
|
#define TILE_ADDXY(tile, x, y) TILE_ADD(tile, TILE_XY(x,y))
|
||||||
|
2
misc.c
2
misc.c
@ -730,7 +730,7 @@ int FindFirstBit(uint32 value)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
extern uint SafeTileAdd(uint tile, int add, const char *exp, const char *file, int line)
|
uint SafeTileAdd(uint tile, int add, const char *exp, const char *file, int line)
|
||||||
{
|
{
|
||||||
uint x = TileX(tile) + (signed char)(add & 0xFF);
|
uint x = TileX(tile) + (signed char)(add & 0xFF);
|
||||||
uint y = TileY(tile) + ((((0x8080 + add)>>8) & 0xFF) - 0x80);
|
uint y = TileY(tile) + ((((0x8080 + add)>>8) & 0xFF) - 0x80);
|
||||||
|
Loading…
Reference in New Issue
Block a user