mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-29 16:01:38 +00:00
mingw32 unicode fixups
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@21955 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
44a6542243
commit
e6fd4ca0d1
18 changed files with 314 additions and 191 deletions
|
@ -2213,21 +2213,27 @@ GSAutoreleasedBuffer(unsigned size)
|
|||
|
||||
|
||||
|
||||
/* Getting a system error message on a variety of systems */
|
||||
/*
|
||||
* Getting a system error message on a variety of systems.
|
||||
* Currently 8bit string ... perhaps we should move to unicode.
|
||||
*/
|
||||
#ifdef __MINGW32__
|
||||
LPTSTR GetErrorMsg(DWORD msgId)
|
||||
|
||||
const char *GetErrorMsg(DWORD msgId)
|
||||
{
|
||||
LPVOID lpMsgBuf;
|
||||
void *lpMsgBuf = 0;
|
||||
|
||||
FormatMessage(
|
||||
FORMAT_MESSAGE_ALLOCATE_BUFFER |
|
||||
FORMAT_MESSAGE_FROM_SYSTEM |
|
||||
FORMAT_MESSAGE_IGNORE_INSERTS,
|
||||
NULL, msgId,
|
||||
FormatMessageA(
|
||||
FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM
|
||||
| FORMAT_MESSAGE_IGNORE_INSERTS,
|
||||
NULL,
|
||||
msgId,
|
||||
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
|
||||
(LPTSTR)&lpMsgBuf, 0, NULL);
|
||||
(LPSTR)&lpMsgBuf,
|
||||
(DWORD)0,
|
||||
NULL);
|
||||
|
||||
return (LPTSTR)lpMsgBuf;
|
||||
return (const char*)lpMsgBuf;
|
||||
}
|
||||
#else
|
||||
#ifndef HAVE_STRERROR
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue