From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1585) id B858C3858403; Tue, 16 Aug 2022 17:09:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B858C3858403 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Luis Machado To: bfd-cvs@sourceware.org Subject: [binutils-gdb] bfd: Define ___lc_codepage_func prototype for older MinGW-w64 X-Act-Checkin: binutils-gdb X-Git-Author: =?utf-8?q?Torbj=C3=B6rn_SVENSSON?= X-Git-Refname: refs/heads/master X-Git-Oldrev: 9096fc28c62741bfb7962eb5dfdee28a7b1d1345 X-Git-Newrev: 4ae982e83ced08a78af98f738878e28e4066d72b Message-Id: <20220816170907.B858C3858403@sourceware.org> Date: Tue, 16 Aug 2022 17:09:07 +0000 (GMT) X-BeenThere: binutils-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Aug 2022 17:09:07 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D4ae982e83ced= 08a78af98f738878e28e4066d72b commit 4ae982e83ced08a78af98f738878e28e4066d72b Author: Torbj=C3=B6rn SVENSSON Date: Tue Aug 16 18:04:21 2022 +0100 bfd: Define ___lc_codepage_func prototype for older MinGW-w64 =20 In commit 68e80d96a84282d547f3b3c1234c99009521630c, the usage of ___lc_codepage_func was introduced to determine the current encoding. =20 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: =20 error: implicit declaration of function =E2=80=98___lc_codepage_func=E2= =80=99 =20 This changeset adds a conditonal definition of ___lc_codepage_func to allow a sucessful build with MinGW-w64. =20 Signed-off-by: Torbj=C3=B6rn SVENSSON Diff: --- bfd/bfdio.c | 5 +++++ 1 file changed, 5 insertions(+) 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 =20 +#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