mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-23 03:22:08 +00:00
Use inttypes for stdint types
This should help make RGBDS portable to systems with 16-bit integers, like DOS. For kicks, use the macros for 16-bit and 8-bit integers. Fix other miscellaneous things, like #include ordering and other printf-format related things. Reduce repitition in math.c while I'm there.
This commit is contained in:
@@ -6,12 +6,13 @@
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <stdio.h>
|
||||
#include <inttypes.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "link/object.h"
|
||||
#include "link/symbol.h"
|
||||
@@ -65,7 +66,7 @@ noreturn_ void fatal(char const *fmt, ...)
|
||||
if (nbErrors != UINT32_MAX)
|
||||
nbErrors++;
|
||||
|
||||
fprintf(stderr, "Linking aborted after %u error%s\n", nbErrors,
|
||||
fprintf(stderr, "Linking aborted after %" PRIu32 " error%s\n", nbErrors,
|
||||
nbErrors != 1 ? "s" : "");
|
||||
exit(1);
|
||||
}
|
||||
@@ -245,8 +246,8 @@ int main(int argc, char *argv[])
|
||||
/* and finally output the result. */
|
||||
patch_ApplyPatches();
|
||||
if (nbErrors) {
|
||||
fprintf(stderr, "Linking failed with %u error%s\n", nbErrors,
|
||||
nbErrors != 1 ? "s" : "");
|
||||
fprintf(stderr, "Linking failed with %" PRIu32 " error%s\n",
|
||||
nbErrors, nbErrors != 1 ? "s" : "");
|
||||
exit(1);
|
||||
}
|
||||
out_WriteFiles();
|
||||
|
||||
Reference in New Issue
Block a user