]> granicus.if.org Git - nethack/commitdiff
tile2x11.c needs a local copy of FITSuint_ for alloc.o
authornhkeni <keni@his.com>
Fri, 18 Mar 2022 00:20:39 +0000 (20:20 -0400)
committernhkeni <keni@his.com>
Fri, 18 Mar 2022 00:20:39 +0000 (20:20 -0400)
win/X11/tile2x11.c

index 2f774065ae8a058bdb410dd982c26eb5406a4cb0..97059dd5ebb0609135b1004855c0f0bae7d72425 100644 (file)
@@ -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;
+}
+