[PATCH] bfd: Define func prototype for old mingw

Luis Machado luis.machado@arm.com
Mon Aug 15 10:01:06 GMT 2022


Just some nits...
On 8/15/22 09:49, Torbjörn SVENSSON wrote:
> 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 caused
> error: implicit declaration of function ‘___lc_codepage_func’
> when building.  This changeset adds a conditonal definition of
> ___lc_codepage_func to allow a sucessful build with MinGW-w64.

sucessful -> successful
> 
> Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
> ---
>   bfd/bfdio.c | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/bfd/bfdio.c b/bfd/bfdio.c
> index a7c7d5bd363..59f79203b88 100644
> --- a/bfd/bfdio.c
> +++ b/bfd/bfdio.c
> @@ -29,6 +29,11 @@
>   #if defined (_WIN32)
>   #include <windows.h>
>   #include <locale.h>
> +
> +#if defined(__MINGW64_VERSION_MAJOR) && __MINGW64_VERSION_MAJOR < 9
> +/* This prototype was added to locale.h in version 9.0 of MinaGW-w64.  */

MinaGW-w64 -> MinGW-w64
> +_CRTIMP unsigned int __cdecl ___lc_codepage_func(void);

I don't see any occurrences of CRTIMP in binutils-gdb. Should we not use that?

> +#endif
>   #endif
>   
>   #ifndef S_IXUSR



More information about the Binutils mailing list