mirror of https://github.com/OpenTTD/OpenTTD
(svn r1416) Print sensible information in SafeTileAdd() if gcc is used
parent
35972e68e1
commit
76c7f3b14e
2
macros.h
2
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))
|
# define TILE_ADD(x,y) ((x)+(y))
|
||||||
#else
|
#else
|
||||||
# if defined(__GNUC__)
|
# 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
|
# else
|
||||||
# define TILE_ADD(x,y) (SafeTileAdd((x),(y), #x ## ", " ## #y, __FILE__, __LINE__))
|
# define TILE_ADD(x,y) (SafeTileAdd((x),(y), #x ## ", " ## #y, __FILE__, __LINE__))
|
||||||
# endif
|
# endif
|
||||||
|
|
2
misc.c
2
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);
|
sprintf(buf, "TILE_ADD(%s) when adding 0x%.4X and %d failed", exp, tile, add);
|
||||||
#if !defined(_DEBUG) || !defined(_MSC_VER)
|
#if !defined(_DEBUG) || !defined(_MSC_VER)
|
||||||
printf("%s\n", buf);
|
fprintf(stderr, "%s:%d %s\n", file, line, buf);
|
||||||
#else
|
#else
|
||||||
_assert(buf, (char*)file, line);
|
_assert(buf, (char*)file, line);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue