s4:scripting: Fix ntstatus_gen.h generation on 32bit
authorAndreas Schneider <asn@samba.org>
Wed, 25 Oct 2017 15:37:24 +0000 (17:37 +0200)
committerDavid Disseldorp <ddiss@samba.org>
Wed, 25 Oct 2017 20:28:39 +0000 (22:28 +0200)
The hex() function results in different output on 32bit systems. It adds
a L for long for some numbers. Thus we have a different header file.

This patch makes sure we have a consistent file generation on different
paltforms.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Wed Oct 25 22:28:39 CEST 2017 on sn-devel-144

source4/scripting/bin/gen_ntstatus.py

index 9e92f49fc1bdc0374a4865e02fc8603eaa76c94c..cace4c08ce57da4f7d3da6c05e47a94b08806fb3 100755 (executable)
@@ -32,7 +32,7 @@ def generateHeaderFile(out_file, errors):
     out_file.write("#ifndef _NTSTATUS_GEN_H\n")
     out_file.write("#define _NTSTATUS_GEN_H\n")
     for err in errors:
-        line = "#define %s NT_STATUS(%s)\n" % (err.err_define, hex(err.err_code))
+        line = "#define %s NT_STATUS(%#x)\n" % (err.err_define, err.err_code)
         out_file.write(line)
     out_file.write("\n#endif /* _NTSTATUS_GEN_H */\n")