aboutsummaryrefslogtreecommitdiff
path: root/bfd/bfdio.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2022-12-20 18:01:07 +1030
committerEli Zaretskii <eliz@gnu.org>2022-12-22 12:37:55 +0200
commitcadab61a48da0136caf42ee18fadb18066e919c5 (patch)
tree516d3e11f3f84b0522c50bf55851a86038ef4194 /bfd/bfdio.c
parent4547ad37f8062eb6763774c068522825451446dc (diff)
downloadgdb-cadab61a48da0136caf42ee18fadb18066e919c5.zip
gdb-cadab61a48da0136caf42ee18fadb18066e919c5.tar.gz
gdb-cadab61a48da0136caf42ee18fadb18066e919c5.tar.bz2
PR29915, bfdio.c does not compile with mingw.org's MinGW
PR 29915 * configure.ac: Add AC_CHECK_DECLS test ___lc_codepage_func. * configure: Regenerate. * config.in: Regenerate. * bfdio.c (___lc_codepage_func): Move declaration to.. (_bfd_real_fopen): ..here, and use !HAVE_DECL____LC_CODEPAGE_FUNC. (cherry picked from commit 9d0991449285833b9a77cc02850a1e113e460362)
Diffstat (limited to 'bfd/bfdio.c')
-rw-r--r--bfd/bfdio.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/bfd/bfdio.c b/bfd/bfdio.c
index 571f12b..a67d4bb 100644
--- a/bfd/bfdio.c
+++ b/bfd/bfdio.c
@@ -31,11 +31,6 @@
#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
@@ -127,7 +122,11 @@ _bfd_real_fopen (const char *filename, const char *modes)
const wchar_t prefix[] = L"\\\\?\\";
const size_t partPathLen = strlen (filename) + 1;
#ifdef __MINGW32__
- const unsigned int cp = ___lc_codepage_func();
+#if !HAVE_DECL____LC_CODEPAGE_FUNC
+/* This prototype was added to locale.h in version 9.0 of MinGW-w64. */
+ _CRTIMP unsigned int __cdecl ___lc_codepage_func (void);
+#endif
+ const unsigned int cp = ___lc_codepage_func ();
#else
const unsigned int cp = CP_UTF8;
#endif