Style: Integrate #pragma once in builders/checks

This commit is contained in:
Thaddeus Crews
2025-02-01 10:11:55 -06:00
parent 7459a0361d
commit 96fdaa616b
17 changed files with 44 additions and 197 deletions

View File

@ -14,8 +14,7 @@ def run(target, source, env):
g.write(
"""/* THIS FILE IS GENERATED DO NOT EDIT */
#ifndef GDEXTENSION_INTERFACE_DUMP_H
#define GDEXTENSION_INTERFACE_DUMP_H
#pragma once
#ifdef TOOLS_ENABLED
@ -49,7 +48,5 @@ class GDExtensionInterfaceDump {
};
#endif // TOOLS_ENABLED
#endif // GDEXTENSION_INTERFACE_DUMP_H
"""
)

View File

@ -119,10 +119,7 @@ def generate_ex_version(argcount, const=False, returns=False):
def run(target, source, env):
max_versions = 12
txt = """
#ifndef GDEXTENSION_WRAPPERS_GEN_H
#define GDEXTENSION_WRAPPERS_GEN_H
"""
txt = "#pragma once"
for i in range(max_versions + 1):
txt += "\n/* Extension Wrapper " + str(i) + " Arguments */\n"
@ -138,7 +135,5 @@ def run(target, source, env):
txt += generate_mod_version(i, True, False)
txt += generate_mod_version(i, True, True)
txt += "\n#endif\n"
with open(str(target[0]), "w", encoding="utf-8", newline="\n") as f:
f.write(txt)