pidl/python: add prototypes into header section of generated c-files.
authorGünther Deschner <gd@samba.org>
Wed, 25 Mar 2015 16:38:12 +0000 (17:38 +0100)
committerMichael Adam <obnox@samba.org>
Wed, 25 Mar 2015 19:45:01 +0000 (20:45 +0100)
This stops emmiting hundreds of warnings when compiling with
-Wmissing-prototypes.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Wed Mar 25 20:45:01 CET 2015 on sn-devel-104

pidl/lib/Parse/Pidl/Samba4/Python.pm

index 91201bbd1f122407489583cfb669f2889d28e9f6..b634137cd5db668dab3c3900b2a9761b411c8744 100644 (file)
@@ -645,6 +645,7 @@ sub PythonType($$$$)
 
        if ($actual_ctype->{TYPE} eq "UNION" and defined($actual_ctype->{ELEMENTS})) {
                $self->pidl("PyObject *py_import_$d->{NAME}(TALLOC_CTX *mem_ctx, int level, " .mapTypeName($d) . " *in)");
+               $self->pidl_hdr("PyObject *py_import_$d->{NAME}(TALLOC_CTX *mem_ctx, int level, " .mapTypeName($d) . " *in);\n");
                $self->pidl("{");
                $self->indent;
                $self->FromUnionToPythonFunction("mem_ctx", $actual_ctype, "level", "in") if ($actual_ctype->{TYPE} eq "UNION");
@@ -653,6 +654,7 @@ sub PythonType($$$$)
                $self->pidl("");
 
                $self->pidl(mapTypeName($d) . " *py_export_$d->{NAME}(TALLOC_CTX *mem_ctx, int level, PyObject *in)");
+               $self->pidl_hdr(mapTypeName($d) . " *py_export_$d->{NAME}(TALLOC_CTX *mem_ctx, int level, PyObject *in);\n");
                $self->pidl("{");
                $self->indent;
                $self->FromPythonToUnionFunction($actual_ctype, mapTypeName($d), "level", "mem_ctx", "in") if ($actual_ctype->{TYPE} eq "UNION");