summaryrefslogtreecommitdiff
path: root/pidl
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2016-01-18 15:53:15 +1300
committerAndrew Bartlett <abartlet@samba.org>2016-01-18 04:42:21 +0100
commita2d49fa74f2a4b3cf8b22f4b5686d18f3204fcfb (patch)
tree0c0b3a3bba927bba40ea3740ce401bff7673f62a /pidl
parentcff17f0a8ccf697d2836fe5b32b621995a9fc432 (diff)
downloadsamba-a2d49fa74f2a4b3cf8b22f4b5686d18f3204fcfb.tar.gz
pidl: Change PyGetSetDef in generated python bindings to use C99 initialisers
Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Diffstat (limited to 'pidl')
-rw-r--r--pidl/lib/Parse/Pidl/Samba4/Python.pm11
1 files changed, 9 insertions, 2 deletions
diff --git a/pidl/lib/Parse/Pidl/Samba4/Python.pm b/pidl/lib/Parse/Pidl/Samba4/Python.pm
index 82f92195742..f2cb5387751 100644
--- a/pidl/lib/Parse/Pidl/Samba4/Python.pm
+++ b/pidl/lib/Parse/Pidl/Samba4/Python.pm
@@ -237,9 +237,16 @@ sub PythonStruct($$$$$$)
$self->pidl("static PyGetSetDef ".$getsetters."[] = {");
$self->indent;
foreach my $e (@{$d->{ELEMENTS}}) {
- $self->pidl("{ discard_const_p(char, \"$e->{NAME}\"), py_$name\_get_$e->{NAME}, py_$name\_set_$e->{NAME} },");
+ $self->pidl("{");
+ $self->indent;
+ $self->pidl(".name = discard_const_p(char, \"$e->{NAME}\"),");
+ $self->pidl(".get = py_$name\_get_$e->{NAME},");
+ $self->pidl(".set = py_$name\_set_$e->{NAME},");
+ $self->pidl(".doc = discard_const_p(char, \"PIDL-generated element $e->{NAME}\")");
+ $self->deindent;
+ $self->pidl("},");
}
- $self->pidl("{ NULL }");
+ $self->pidl("{ .name = NULL }");
$self->deindent;
$self->pidl("};");
$self->pidl("");