pidl: Allow the compilation of the ndr_table to be skiped
authorAndrew Bartlett <abartlet@samba.org>
Sun, 3 Nov 2019 23:17:41 +0000 (12:17 +1300)
committerDouglas Bagnall <dbagnall@samba.org>
Wed, 13 Nov 2019 00:32:36 +0000 (00:32 +0000)
libnetapi.idl defines a large number of functions a nopull,nopush and
no replacement is provided.

This will allow the ndr_table to be generated for all other IDL files
that may have public structures that could usefully be dumped by
ndrdump.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14191

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Pair-progammed-with: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>

pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm

index 2fc4327faf48cf590339fac28322891ff8522e33..b896398355c12b554d056678f0e0674dbf7b6b87 100644 (file)
@@ -3093,7 +3093,16 @@ sub ParseInterface($$$)
                ($needed->{"ndr_print_$d->{NAME}"}) && $self->ParseFunctionPrint($d);
        }
 
+        # Allow compilation of generated files where replacement functions
+        # for structures declared nopull/nopush have not been provided.
+        #
+        # This makes sense when only the print functions are used
+        #
+        # Otherwise the ndr_table XXX will reference these
+
+        $self->pidl("#ifndef SKIP_NDR_TABLE_$interface->{NAME}");
        $self->FunctionTable($interface);
+        $self->pidl("#endif /* SKIP_NDR_TABLE_$interface->{NAME} */");
 
        $self->pidl_hdr("#endif /* _HEADER_NDR_$interface->{NAME} */");
 }