Fix windows.h inclusion for crosses to MinGW

Kai Tietz ktietz70@googlemail.com
Wed Mar 23 18:33:00 GMT 2011


2011/3/23 Joseph S. Myers <joseph@codesourcery.com>:
> The ld configure test for plugins on Windows includes Windows.h, as does
> plugin.c.  But the header included in MinGW's w32api distribution is
> actually windows.h not Windows.h, so the configure test fails when the
> host is MinGW but the build system has a case-sensitive filesystem.  This
> patch fixes the test and include to use windows.h.  OK to commit?
>
> 2011-03-23  Joseph Myers  <joseph@codesourcery.com>
>
>        * configure.in: Check for windows.h, not Windows.h.
>        * configure: Regenerate.
>        * plugin.c: Include windows.h, not Windows.h.
>
> Index: configure.in
> ===================================================================
> RCS file: /cvs/src/src/ld/configure.in,v
> retrieving revision 1.68
> diff -u -r1.68 configure.in
> --- configure.in        22 Jan 2011 19:25:37 -0000      1.68
> +++ configure.in        23 Mar 2011 16:55:21 -0000
> @@ -173,7 +173,7 @@
>  AC_CHECK_FUNCS([dlopen dlsym dlclose],[],[enable_plugins=no])
>  # We also support plugins on Windows (MinGW).
>  if test x$enable_plugins = xno ; then
> -  AC_CHECK_HEADERS([Windows.h],[enable_plugins=yes],[],[AC_INCLUDES_DEFAULT])
> +  AC_CHECK_HEADERS([windows.h],[enable_plugins=yes],[],[AC_INCLUDES_DEFAULT])
>  fi
>  AM_CONDITIONAL([ENABLE_PLUGINS], [test x$enable_plugins = xyes])
>
> Index: plugin.c
> ===================================================================
> RCS file: /cvs/src/src/ld/plugin.c,v
> retrieving revision 1.28
> diff -u -r1.28 plugin.c
> --- plugin.c    10 Mar 2011 10:27:50 -0000      1.28
> +++ plugin.c    23 Mar 2011 16:55:21 -0000
> @@ -33,7 +33,7 @@
>  #include "plugin-api.h"
>  #include "elf-bfd.h"
>  #if !defined (HAVE_DLFCN_H) && defined (HAVE_WINDOWS_H)
> -#include <Windows.h>
> +#include <windows.h>
>  #endif
>
>  /* Report plugin symbols.  */
>
> --
> Joseph S. Myers
> joseph@codesourcery.com

Hi Joseph,

I had this patch already in my tree but missed to post it. I can't
approve it, but I can confirm that it works.

Regards,
Kai



More information about the Binutils mailing list