mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Export windows_format_system_message
utility on Windows
Declare the function in `system.h`, so we can use it in other platform-specific components.
This commit is contained in:
parent
f78fd6bda1
commit
f7d3052170
|
@ -1437,7 +1437,7 @@ static int priv_net_close_all_sockets(NETSOCKET sock)
|
|||
}
|
||||
|
||||
#if defined(CONF_FAMILY_WINDOWS)
|
||||
static char *windows_format_system_message(unsigned long error)
|
||||
char *windows_format_system_message(unsigned long error)
|
||||
{
|
||||
WCHAR *wide_message;
|
||||
const DWORD flags = FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_MAX_WIDTH_MASK;
|
||||
|
|
|
@ -1147,6 +1147,20 @@ void net_unix_set_addr(UNIXSOCKETADDR *addr, const char *path);
|
|||
*/
|
||||
void net_unix_close(UNIXSOCKET sock);
|
||||
|
||||
#elif defined(CONF_FAMILY_WINDOWS)
|
||||
|
||||
/**
|
||||
* Formats a Windows error code as a human-readable string.
|
||||
*
|
||||
* @param error The Windows error code.
|
||||
*
|
||||
* @return A new string representing the error code.
|
||||
*
|
||||
* @remark Guarantees that result will contain zero-termination.
|
||||
* @remark The result must be freed after it has been used.
|
||||
*/
|
||||
char *windows_format_system_message(unsigned long error);
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue