From ebe08a8c75e05c8477657ebf6c61449d45806b94 Mon Sep 17 00:00:00 2001 From: nhkeni Date: Thu, 17 Mar 2022 19:27:02 -0400 Subject: [PATCH] tile2bmp.c needs a local copy of FITSuint_ for alloc.o --- win/share/tile2bmp.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/win/share/tile2bmp.c b/win/share/tile2bmp.c index dc35a8388..d45bbbd83 100644 --- a/win/share/tile2bmp.c +++ b/win/share/tile2bmp.c @@ -99,6 +99,8 @@ lelong(INT32 x) #endif } +unsigned FITSuint_(unsigned long long, const char *, int); + #ifdef __GNUC__ typedef struct tagBMIH { UINT32 biSize; @@ -376,3 +378,15 @@ build_bmptile(pixel(*pixels)[TILE_X]) } } } + +/* 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(EXIT_FAILURE); + } + return (unsigned)i; +} +