summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-01-07 17:47:29 +0000
committertron <tron@openttd.org>2005-01-07 17:47:29 +0000
commitd06b2791eb682b704938c88773b1b82a7fd439bc (patch)
tree81b525629548d21d2ca57ab7acb702b667f72c3f
parent872c51f1340d8555dd41e9f0e1fb577354d480ac (diff)
downloadopenttd-d06b2791eb682b704938c88773b1b82a7fd439bc.tar.xz
(svn r1416) Print sensible information in SafeTileAdd() if gcc is used
-rw-r--r--macros.h2
-rw-r--r--misc.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/macros.h b/macros.h
index 227da3871..bd5604419 100644
--- a/macros.h
+++ b/macros.h
@@ -87,7 +87,7 @@ extern uint SafeTileAdd(uint x, int add, const char *exp, const char *file, int
# define TILE_ADD(x,y) ((x)+(y))
#else
# if defined(__GNUC__)
-# define TILE_ADD(x,y) (SafeTileAdd((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
diff --git a/misc.c b/misc.c
index 7a7b41d51..c37122df7 100644
--- a/misc.c
+++ b/misc.c
@@ -740,7 +740,7 @@ extern uint SafeTileAdd(uint tile, int add, const char *exp, const char *file, i
sprintf(buf, "TILE_ADD(%s) when adding 0x%.4X and %d failed", exp, tile, add);
#if !defined(_DEBUG) || !defined(_MSC_VER)
- printf("%s\n", buf);
+ fprintf(stderr, "%s:%d %s\n", file, line, buf);
#else
_assert(buf, (char*)file, line);
#endif