summaryrefslogtreecommitdiff
path: root/src/windows.cpp
blob: 988256838ad9ca33d768e1818e43afe5740646fd (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
 /* POSIX emulation layer for Windows.
 *
 * Copyright (C) 2008 Robin Burchell <w00t@inspircd.org>
 * Copyright (C) 2008 Anope Team <info@anope.org>
 *
 * Please read COPYING and README for further details.
 *
 * Based on the original code of Epona by Lara.
 * Based on the original code of Services by Andy Church.
 *
 * $Id$
 *
 */

#ifdef WIN32
#include <windows.h>

const char *dlerror()
{
	static char errbuf[513];
	DWORD err = GetLastError();
	if (!err)
		return NULL;
	FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, err, 0, errbuf, 512, NULL);
	return errbuf;
}
#endif