summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
Diffstat (limited to 'source4')
-rw-r--r--source4/scripting/swig/samba.i19
1 files changed, 8 insertions, 11 deletions
diff --git a/source4/scripting/swig/samba.i b/source4/scripting/swig/samba.i
index a989a468b9..6cdf424095 100644
--- a/source4/scripting/swig/samba.i
+++ b/source4/scripting/swig/samba.i
@@ -24,17 +24,14 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-%typemap(in) uint32 {
- if (!PyInt_Check($input) && !PyLong_Check($input)) {
- PyErr_SetString(PyExc_TypeError, "integer expected");
- return NULL;
- }
- $1 = (uint32_t)PyLong_AsLong($input);
-}
-
-%typemap(out) uint32 {
- $result = PyLong_FromLong($1);
-}
+%apply unsigned char { uint8_t };
+%apply char { int8_t };
+%apply unsigned int { uint16_t };
+%apply int { int16_t };
+%apply unsigned long { uint32_t };
+%apply long { int32_t };
+%apply unsigned long long { uint64_t };
+%apply long long { int64_t };
%typemap(out) NTSTATUS {
$result = PyLong_FromLong(NT_STATUS_V($1));