pidl: Allow the compilation of the ndr_table to be skiped
[amitay/samba.git] / 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} */");
 }