retro-embedimage: declare cell type correctly for 64-bit

FossilOrigin-Name: 5c193087801db69682131bb96f0d2f5b0c0a502f73f2d6784d8ad05d6e769d4e
This commit is contained in:
crc 2021-04-22 13:31:42 +00:00
parent 75c540308f
commit ccd735b1f9

View file

@ -48,7 +48,15 @@ CELL ngaLoadImage(char *imageFile) {
void output_header(int size) {
printf("#include <stdint.h>\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[] = { ");