summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-01-14 16:49:19 +0100
committerJelmer Vernooij <jelmer@samba.org>2008-01-14 19:53:07 +0100
commit860106b3f426a06eed6a681fa839dd89f339ba9a (patch)
treebd3f6371af93e8b359616cd063a4d4ba63a96a90
parenta896c8940ca372808c0725bc4f2725f6cb8467b8 (diff)
downloadsamba-860106b3f426a06eed6a681fa839dd89f339ba9a.tar.gz
samba-860106b3f426a06eed6a681fa839dd89f339ba9a.tar.bz2
samba-860106b3f426a06eed6a681fa839dd89f339ba9a.zip
python: Move some convenience macros to a separate header rather than putting them in every generated py_* file.
(This used to be commit 712274b9bdf524da125cbbe6e4bb475b21b1da66)
-rw-r--r--source4/pidl/lib/Parse/Pidl/Samba4/Python.pm8
-rw-r--r--source4/scripting/python/pyrpc.h2
2 files changed, 4 insertions, 6 deletions
diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/Python.pm b/source4/pidl/lib/Parse/Pidl/Samba4/Python.pm
index 0d5237022a..84b3405bb9 100644
--- a/source4/pidl/lib/Parse/Pidl/Samba4/Python.pm
+++ b/source4/pidl/lib/Parse/Pidl/Samba4/Python.pm
@@ -886,20 +886,16 @@ sub Parse($$$$$)
#include <Python.h>
#include \"librpc/rpc/dcerpc.h\"
#include \"scripting/python/pytalloc.h\"
+#include \"scripting/python/pyrpc.h\"
#include \"$hdr\"
#include \"$ndr_hdr\"
#include \"$py_hdr\"
-#define PY_CHECK_TYPE(type, var, fail) \\
- if (!type ## _Check(var)) {\\
- PyErr_Format(PyExc_TypeError, \"Expected type %s\", type ## _Type.tp_name); \\
- fail; \\
- }
");
foreach my $x (@$ndr) {
- ($x->{TYPE} eq "INTERFACE") && $self->Interface($x, $basename);
($x->{TYPE} eq "IMPORT") && $self->Import(@{$x->{PATHS}});
+ ($x->{TYPE} eq "INTERFACE") && $self->Interface($x, $basename);
}
$self->pidl("static PyMethodDef $basename\_methods[] = {");
diff --git a/source4/scripting/python/pyrpc.h b/source4/scripting/python/pyrpc.h
index d7b64dbe93..5390c6923d 100644
--- a/source4/scripting/python/pyrpc.h
+++ b/source4/scripting/python/pyrpc.h
@@ -25,3 +25,5 @@
#define dom_sid2_Type dom_sid_Type
#define dom_sid28_Type dom_sid_Type
+#define dom_sid2_Check dom_sid_Check
+#define dom_sid28_Check dom_sid28_Check