]> Savannah Git Hosting - gnulib.git/commitdiff
nl_langinfo: fix build under mingw
authorPavel Hrdina <phrdina@redhat.com>
Wed, 9 Jul 2014 11:13:07 +0000 (13:13 +0200)
committerEric Blake <eblake@redhat.com>
Wed, 9 Jul 2014 22:04:09 +0000 (16:04 -0600)
The commit fcfce839 improved localization of names for week days
and months, but the author forget to include windows.h in order
to use 'GetACP ()'. Without this header file build using mingw
fails with this error message:

../../../gnulib/lib/nl_langinfo.c: In function 'ctype_codeset':
../../../gnulib/lib/nl_langinfo.c:76:5: warning: implicit declaration of
function 'GetACP' [-Wimplicit-function-declaration]
     sprintf (buf + 2, "%u", GetACP ());
     ^
In file included from
/usr/i686-w64-mingw32/sys-root/mingw/include/windows.h:73:0,
                 from ../../../gnulib/lib/nl_langinfo.c:149:
/usr/i686-w64-mingw32/sys-root/mingw/include/winnls.h: At top level:
/usr/i686-w64-mingw32/sys-root/mingw/include/winnls.h:653:64: error:
conflicting types for 'GetACP'
   WINBASEAPI UINT WINAPI GetACP(void);
                                                                ^
../../../gnulib/lib/nl_langinfo.c:76:29: note: previous implicit
declaration of 'GetACP' was here
     sprintf (buf + 2, "%u", GetACP ());
                             ^

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
ChangeLog
lib/nl_langinfo.c

index a70340a59c24aaf984b2e35958550dd628ddf55f..66fd9c83485ed1539907bff24f1c3abd27f2ec60 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2014-07-09  Pavel Hrdina  <phrdina@redhat.com> (tiny change)
+
+       nl_langinfo: fix build under mingw
+       * lib/nl_langinfo.c (includes): Pick up <windows.h> for GetACP().
+
 2014-07-09  Andrew D Warshall  <warshall@99main.com>
 
        mountlist: do not classify a bind-mounted dir entry as "dummy"
index b0be82167629e6e9c823334a4bb92facd0be451c..b5f2000d2d164049563191764909047ff2a6b65f 100644 (file)
@@ -23,6 +23,7 @@
 #include <locale.h>
 #include <string.h>
 #if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# include <windows.h>
 # include <stdio.h>
 #endif