[pypy-commit] cffi default: Add dlerror() for windows.

arigo noreply at buildbot.pypy.org
Tue Oct 9 11:37:57 CEST 2012


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r992:7673342ae1c2
Date: 2012-10-09 11:37 +0200
http://bitbucket.org/cffi/cffi/changeset/7673342ae1c2/

Log:	Add dlerror() for windows.

diff --git a/c/misc_win32.h b/c/misc_win32.h
--- a/c/misc_win32.h
+++ b/c/misc_win32.h
@@ -103,6 +103,16 @@
     FreeLibrary((HMODULE)handle);
 }
 
+static const char *dlerror(void)
+{
+    static char buf[32];
+    DWORD dw = GetLastError(); 
+    if (dw == 0)
+        return NULL;
+    sprintf(buf, "error 0x%x", (unsigned int)dw);
+    return buf;
+}
+
 
 /************************************************************/
 /* obscure */


More information about the pypy-commit mailing list