From ccd735b1f91b6570b08bacabbb6c4118d9315237 Mon Sep 17 00:00:00 2001 From: crc Date: Thu, 22 Apr 2021 13:31:42 +0000 Subject: [PATCH] retro-embedimage: declare cell type correctly for 64-bit FossilOrigin-Name: 5c193087801db69682131bb96f0d2f5b0c0a502f73f2d6784d8ad05d6e769d4e --- tools/retro-embedimage.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/retro-embedimage.c b/tools/retro-embedimage.c index 14d223d..3251a1e 100644 --- a/tools/retro-embedimage.c +++ b/tools/retro-embedimage.c @@ -48,7 +48,15 @@ CELL ngaLoadImage(char *imageFile) { void output_header(int size) { printf("#include \n"); printf("#ifndef CELL\n"); + printf("#ifndef BIT64\n"); printf("#define CELL int32_t\n"); + printf("#define CELL_MIN INT_MIN + 1\n"); + printf("#define CELL_MAX INT_MAX - 1\n"); + printf("#else\n"); + printf("#define CELL int64_t\n"); + printf("#define CELL_MIN LLONG_MIN + 1\n"); + printf("#define CELL_MAX LLONG_MAX - 1\n"); + printf("#endif\n"); printf("#endif\n"); printf("CELL ngaImageCells = %lld;\n", (long long)size); printf("CELL ngaImage[] = { ");