summaryrefslogtreecommitdiff
path: root/src/windows.cpp
diff options
context:
space:
mode:
authorrburchell <rburchell@5417fbe8-f217-4b02-8779-1006273d7864>2009-02-09 21:01:05 +0000
committerrburchell <rburchell@5417fbe8-f217-4b02-8779-1006273d7864>2009-02-09 21:01:05 +0000
commitd7d01bdc5c667a1fafd95241282b58e03b4caa5b (patch)
treef1482d8734da609923c6d8af6bc8fcb0fc187534 /src/windows.cpp
parentd49b3a25fda5f597491e73640dd1e76babc240eb (diff)
Squashed commit: merge next (1.9.1) back to trunk.
SVN users, NOTE: THIS WILL NOT BUILD, NOR SHOULD YOU RUN IT YET. git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1953 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/windows.cpp')
-rw-r--r--src/windows.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/windows.cpp b/src/windows.cpp
new file mode 100644
index 000000000..29a2131d1
--- /dev/null
+++ b/src/windows.cpp
@@ -0,0 +1,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
+const char *dlerror()
+{
+ static char errbuf[513];
+ DWORD err = GetLastError();
+ if (err == 0)
+ return NULL;
+ FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM |
+ FORMAT_MESSAGE_IGNORE_INSERTS, NULL, err, 0, errbuf, 512,
+ NULL);
+ return errbuf;
+}
+#endif