public inbox for binutils-cvs@sourceware.org
 help / color / mirror / Atom feed
From: Luis Machado <luisgpm@sourceware.org>
To: bfd-cvs@sourceware.org
Subject: [binutils-gdb] bfd: Define ___lc_codepage_func prototype for older MinGW-w64
Date: Tue, 16 Aug 2022 17:09:07 +0000 (GMT)	[thread overview]
Message-ID: <20220816170907.B858C3858403@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=4ae982e83ced08a78af98f738878e28e4066d72b

commit 4ae982e83ced08a78af98f738878e28e4066d72b
Author: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
Date:   Tue Aug 16 18:04:21 2022 +0100

    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 <torbjorn.svensson@foss.st.com>

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 <locale.h>
 #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

                 reply	other threads:[~2022-08-16 17:09 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220816170907.B858C3858403@sourceware.org \
    --to=luisgpm@sourceware.org \
    --cc=bfd-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).