changeset 928:c5651758bdc4 draft

(svn r1416) Print sensible information in SafeTileAdd() if gcc is used
author tron <tron@openttd.org>
date Fri, 07 Jan 2005 17:47:29 +0000
parents cd71a8b5bf3a
children 52cd2f236b44
files macros.h misc.c
diffstat 2 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/macros.h
+++ b/macros.h
@@ -87,7 +87,7 @@
 #	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
--- a/misc.c
+++ b/misc.c
@@ -740,7 +740,7 @@
 
 		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