From: nhkeni Date: Fri, 18 Mar 2022 00:20:39 +0000 (-0400) Subject: tile2x11.c needs a local copy of FITSuint_ for alloc.o X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f32ab9d7927f75e8f5c432c258eab8bb0a184d5f;p=nethack tile2x11.c needs a local copy of FITSuint_ for alloc.o --- diff --git a/win/X11/tile2x11.c b/win/X11/tile2x11.c index 2f774065a..97059dd5e 100644 --- a/win/X11/tile2x11.c +++ b/win/X11/tile2x11.c @@ -240,3 +240,15 @@ main(int argc, char *argv[]) fclose(fp); return 0; } + +/* we need a local copy of this for alloc.o and because we don't have panic() */ +unsigned +FITSuint_(unsigned long long i, const char *file, int line){ + unsigned ret = (unsigned)i; + if (ret != i) { + Fprintf(stderr, "Overflow at %s:%d", file, line); + exit(1); + } + return (unsigned)i; +} +