swig: make the code more portable and use NT_STATUS_V() and W_ERROR_V()
authorStefan Metzmacher <metze@samba.org>
Fri, 14 Mar 2008 13:32:26 +0000 (14:32 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 14 Mar 2008 13:33:54 +0000 (14:33 +0100)
metze
(This used to be commit d6fd98a307f83fd492ef73bf6ec281f9f11286f2)

source4/libcli/util/errors.i

index ede536a99579ebf0823b86b410a49c8a8b3ce59d..17efcbf62a8ca4e392b39b744c684c7ac14bdae2 100644 (file)
@@ -20,7 +20,7 @@
 #ifdef SWIGPYTHON
 %typemap(out,noblock=1) WERROR {
     if (!W_ERROR_IS_OK($1)) {
-        PyObject *obj = Py_BuildValue((char *)"(i,s)", $1.v, win_errstr($1));
+        PyObject *obj = Py_BuildValue((char *)"(i,s)", W_ERROR_V($1), win_errstr($1));
         PyErr_SetObject(PyExc_RuntimeError, obj);
         SWIG_fail;
     } else if ($result == NULL) {
@@ -30,7 +30,7 @@
 
 %typemap(out,noblock=1) NTSTATUS {
     if (NT_STATUS_IS_ERR($1)) {
-        PyObject *obj = Py_BuildValue((char *)"(i,s)", $1.v, nt_errstr($1));
+        PyObject *obj = Py_BuildValue((char *)"(i,s)", NT_STATUS_V($1), nt_errstr($1));
         PyErr_SetObject(PyExc_RuntimeError, obj);
         SWIG_fail;
     } else if ($result == NULL) {