gen_ntstatus.py: Add prototype to generated py_ntstatus.c
authorAndrew Bartlett <abartlet@samba.org>
Tue, 31 Jan 2017 22:55:39 +0000 (11:55 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 14 Feb 2017 08:46:22 +0000 (09:46 +0100)
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
source4/scripting/bin/gen_ntstatus.py

index 4738177aa983cdb570bd67cc6934e56dc1e76161..b234d0121519b43f9dd89bb554a956f1ddcb905a 100755 (executable)
@@ -180,6 +180,10 @@ def generatePythonFile(out_file):
     out_file.write("\t\treturn PyInt_FromLong(v);\n");
     out_file.write("\t}\n");
     out_file.write("}\n\n");
+    # This is needed to avoid a missing prototype error from the C
+    # compiler. There is never a prototype for this function, it is a
+    # module loaded by python with dlopen() and found with dlsym().
+    out_file.write("void initntstatus(void);\n")
     out_file.write("void initntstatus(void)\n")
     out_file.write("{\n")
     out_file.write("\tPyObject *m;\n\n")