Add header guards

This commit is contained in:
2023-11-12 15:43:41 +01:00
parent df5e65f9d7
commit df911c65b7
2 changed files with 9 additions and 0 deletions

View File

@@ -1,3 +1,5 @@
#ifndef Buildingtype_H
#define Buildingtype_H
// This file was generated by: extract_tileset_classes.py
#include <breeze.h>
@@ -258,3 +260,4 @@ static void getBuildingSize(BuildingType type, BzTile *outWidth, BzTile *outHeig
}
}
#endif //Buildingtype_H

View File

@@ -40,6 +40,10 @@ def enum_string(name):
return f"{enum_name}_{name.upper()}"
# ============================
header_guard = f"{enum_type.capitalize()}_H"
print(f"#ifndef {header_guard}")
print(f"#define {header_guard}")
script_name = os.path.basename(__file__)
print(f"// This file was generated by: {script_name}")
print()
@@ -185,3 +189,5 @@ print()
# ============================
print(f"#endif //{header_guard}")