summaryrefslogtreecommitdiff
path: root/builds/msvc/errno.cpp
blob: ddfe59ff6aac6abbbf2727ac3e88b54e27133985 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#if defined _WIN32_WCE

//#include "..\..\include\zmq.h"
#include "..\..\src\err.hpp"

int errno;
int _doserrno;
int _sys_nerr;

char* error_desc_buff = NULL;

char* strerror(int errno)
{
	if (NULL != error_desc_buff)
	{
		LocalFree(error_desc_buff);
		error_desc_buff = NULL;
	}

	FormatMessage(
		FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_ALLOCATE_BUFFER,
		NULL,
		errno,
		0,
		(LPTSTR)&error_desc_buff,
		1024,
		NULL
	);
	return error_desc_buff;
}

#endif