summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordarkvater <darkvater@openttd.org>2005-01-08 23:59:49 +0000
committerdarkvater <darkvater@openttd.org>2005-01-08 23:59:49 +0000
commit5edecb9495f3d2046961fcb23ebcbdb08aa9c73e (patch)
treecd709b86f9915b58053a87706ee56bc0d69305f3
parentbfc670b4d98cde9a6e397769e259b43381bb7089 (diff)
downloadopenttd-5edecb9495f3d2046961fcb23ebcbdb08aa9c73e.tar.xz
(svn r1437) -Fix: Safetileadd preprocessor magic is the same as for GCC and no longer extern
-rw-r--r--macros.h8
-rw-r--r--misc.c2
2 files changed, 3 insertions, 7 deletions
diff --git a/macros.h b/macros.h
index bd5604419..69364cfcc 100644
--- a/macros.h
+++ b/macros.h
@@ -81,16 +81,12 @@ enum {
#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)
# define TILE_ADD(x,y) ((x)+(y))
#else
-# if defined(__GNUC__)
-# 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
+# define TILE_ADD(x,y) (SafeTileAdd((x),(y), #x ", " #y, __FILE__, __LINE__))
#endif
#define TILE_ADDXY(tile, x, y) TILE_ADD(tile, TILE_XY(x,y))
diff --git a/misc.c b/misc.c
index c37122df7..81aa6601f 100644
--- a/misc.c
+++ b/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 y = TileY(tile) + ((((0x8080 + add)>>8) & 0xFF) - 0x80);