[pypy-commit] cffi cffi-1.0: ffi.getwinerror() (untested so far)
arigo
noreply at buildbot.pypy.org
Sun Apr 26 11:23:26 CEST 2015
Author: Armin Rigo <arigo at tunes.org>
Branch: cffi-1.0
Changeset: r1837:bc882378fefd
Date: 2015-04-26 11:05 +0200
http://bitbucket.org/cffi/cffi/changeset/bc882378fefd/
Log: ffi.getwinerror() (untested so far)
diff --git a/_cffi1/ffi_obj.c b/_cffi1/ffi_obj.c
--- a/_cffi1/ffi_obj.c
+++ b/_cffi1/ffi_obj.c
@@ -581,6 +581,15 @@
return res;
}
+#ifdef MS_WIN32
+PyDoc_STRVAR(ffi_getwinerror_doc,
+"Return either the GetLastError() or the error number given by the\n"
+"optional 'code' argument, as a tuple '(code, message)'.");
+
+#define ffi_getwinerror b_getwinerror /* ffi_getwinerror() => b_getwinerror()
+ from misc_win32.h */
+#endif
+
PyDoc_STRVAR(ffi_errno_doc, "the value of 'errno' from/to the C calls");
static PyObject *ffi_get_errno(PyObject *self, void *closure)
@@ -703,7 +712,7 @@
{"gc", (PyCFunction)ffi_gc, METH_VARARGS},
#endif
{"getctype", (PyCFunction)ffi_getctype, METH_VARARGS, ffi_getctype_doc},
-#if 0
+#ifdef MS_WIN32
{"getwinerror",(PyCFunction)ffi_getwinerror,METH_VARARGS, ffi_getwinerror_doc},
#endif
{"offsetof", (PyCFunction)ffi_offsetof, METH_VARARGS, ffi_offsetof_doc},
More information about the pypy-commit
mailing list