[Mingw-w64-public] [PATCH] gai_strerrorA: reimplement without FormatMessageA

2013-11-16 Thread Rafaël Carré
(forbidden in Windows Store)
---
 mingw-w64-crt/libsrc/ws2tcpip/gai_strerrorA.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/mingw-w64-crt/libsrc/ws2tcpip/gai_strerrorA.c 
b/mingw-w64-crt/libsrc/ws2tcpip/gai_strerrorA.c
index 8f7f679..ebdc06a 100644
--- a/mingw-w64-crt/libsrc/ws2tcpip/gai_strerrorA.c
+++ b/mingw-w64-crt/libsrc/ws2tcpip/gai_strerrorA.c
@@ -8,10 +8,7 @@
 
 char *gai_strerrorA(int ecode)
 {
-   DWORD dwMsgLen __attribute__((unused));
static char buff[GAI_STRERROR_BUFFER_SIZE + 1];
-   dwMsgLen = 
FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS|FORMAT_MESSAGE_MAX_WIDTH_MASK,
- NULL, ecode, 
MAKELANGID(LANG_NEUTRAL,SUBLANG_DEFAULT), (LPSTR)buff,
- GAI_STRERROR_BUFFER_SIZE, NULL);
+   wcstombs(buff, gai_strerrorW(ecode), GAI_STRERROR_BUFFER_SIZE + 1);
return buff;
 }
-- 
1.8.3.2


--
DreamFactory - Open Source REST  JSON Services for HTML5  Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471iu=/4140/ostg.clktrk
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] [PATCH] gai_strerrorA: reimplement without FormatMessageA

2013-11-16 Thread Kai Tietz
Patch is fine.

Please apply.
Kai

2013/11/16 Rafaël Carré fun...@videolan.org:
 (forbidden in Windows Store)
 ---
  mingw-w64-crt/libsrc/ws2tcpip/gai_strerrorA.c | 5 +
  1 file changed, 1 insertion(+), 4 deletions(-)

 diff --git a/mingw-w64-crt/libsrc/ws2tcpip/gai_strerrorA.c 
 b/mingw-w64-crt/libsrc/ws2tcpip/gai_strerrorA.c
 index 8f7f679..ebdc06a 100644
 --- a/mingw-w64-crt/libsrc/ws2tcpip/gai_strerrorA.c
 +++ b/mingw-w64-crt/libsrc/ws2tcpip/gai_strerrorA.c
 @@ -8,10 +8,7 @@

  char *gai_strerrorA(int ecode)
  {
 -   DWORD dwMsgLen __attribute__((unused));
 static char buff[GAI_STRERROR_BUFFER_SIZE + 1];
 -   dwMsgLen = 
 FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS|FORMAT_MESSAGE_MAX_WIDTH_MASK,
 - NULL, ecode, 
 MAKELANGID(LANG_NEUTRAL,SUBLANG_DEFAULT), (LPSTR)buff,
 - GAI_STRERROR_BUFFER_SIZE, NULL);
 +   wcstombs(buff, gai_strerrorW(ecode), GAI_STRERROR_BUFFER_SIZE + 1);
 return buff;
  }
 --
 1.8.3.2


 --
 DreamFactory - Open Source REST  JSON Services for HTML5  Native Apps
 OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
 Free app hosting. Or install the open source package on any LAMP server.
 Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
 http://pubads.g.doubleclick.net/gampad/clk?id=63469471iu=/4140/ostg.clktrk
 ___
 Mingw-w64-public mailing list
 Mingw-w64-public@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

--
DreamFactory - Open Source REST  JSON Services for HTML5  Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471iu=/4140/ostg.clktrk
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public