From: Torbjörn SVENSSON Date: Tue, 16 Aug 2022 17:04:21 +0000 (+0100) Subject: bfd: Define ___lc_codepage_func prototype for older MinGW-w64 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4ae982e83ced08a78af98f738878e28e4066d72b;p=binutils-gdb.git bfd: Define ___lc_codepage_func prototype for older MinGW-w64 In commit 68e80d96a84282d547f3b3c1234c99009521630c, the usage of ___lc_codepage_func was introduced to determine the current encoding. Prior to version 9.0 of MinGW-w64, the function prototype for ___lc_codepage_func was missing and trying to build BFD caused the following error: error: implicit declaration of function ‘___lc_codepage_func’ This changeset adds a conditonal definition of ___lc_codepage_func to allow a sucessful build with MinGW-w64. Signed-off-by: Torbjörn SVENSSON --- diff --git a/bfd/bfdio.c b/bfd/bfdio.c index a7c7d5bd363..571f12b625a 100644 --- a/bfd/bfdio.c +++ b/bfd/bfdio.c @@ -31,6 +31,11 @@ #include #endif +#if defined(__MINGW64_VERSION_MAJOR) && __MINGW64_VERSION_MAJOR < 9 +/* This prototype was added to locale.h in version 9.0 of MinGW-w64. */ +_CRTIMP unsigned int __cdecl ___lc_codepage_func(void); +#endif + #ifndef S_IXUSR #define S_IXUSR 0100 /* Execute by owner. */ #endif