From ca5fbe5385ed82faf5436f58061c001ae54246b9 Mon Sep 17 00:00:00 2001 From: Aetias Date: Thu, 22 Feb 2024 18:23:26 +0100 Subject: [PATCH] Avoid name collision with `ReadFile` from Win32 --- tools/rom/build.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/rom/build.c b/tools/rom/build.c index 819f09cf..8e799710 100644 --- a/tools/rom/build.c +++ b/tools/rom/build.c @@ -211,7 +211,7 @@ bool LoadArm9Metadata(Arm9Metadata *pMetadata) { // Reads an entire file into a newly allocated buffer and writes it to *pBuffer if successful. // If pFileSize != NULL, this function writes the file's size into *pFileSize. // The buffer can be freed with free(). -bool ReadFile(const char *filePath, uint8_t **pBuffer, uint32_t *pFileSize) { +bool ReadFileAlloc(const char *filePath, uint8_t **pBuffer, uint32_t *pFileSize) { FILE *fp = fopen(filePath, "rb"); if (fp == NULL) FATAL("Failed to open file '%s'\n", filePath); fseek(fp, 0, SEEK_END); @@ -263,7 +263,7 @@ bool WriteArm9Program(FILE *fpRom, size_t *pAddress, uint32_t *pFileSize, uint32 uint8_t *arm9; uint32_t fileSize; - if (!ReadFile(ARM9_PROGRAM_FILE, &arm9, &fileSize)) return false; + if (!ReadFileAlloc(ARM9_PROGRAM_FILE, &arm9, &fileSize)) return false; // Write module info, see spAutoloadBlockInfosStart in asm/main.s // This might seem unsafe since the ARM9 program is compressed, but the addresses we're writing to are in the secure area,