summaryrefslogtreecommitdiff
path: root/src/strgen
diff options
context:
space:
mode:
Diffstat (limited to 'src/strgen')
-rw-r--r--src/strgen/strgen.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/strgen/strgen.cpp b/src/strgen/strgen.cpp
index c6eaa4466..cfae3814d 100644
--- a/src/strgen/strgen.cpp
+++ b/src/strgen/strgen.cpp
@@ -1019,19 +1019,20 @@ static void WriteStringsH(const char *filename)
out = fopen("tmp.xxx", "w");
if (out == NULL) fatal("can't open tmp.xxx");
- fprintf(out, "enum StringIdEnum {");
+ fprintf(out, "/* This file is automatically generated. Do not modify */\n\n");
+ fprintf(out, "#ifndef TABLE_STRINGS_H\n");
+ fprintf(out, "#define TABLE_STRINGS_H\n");
lastgrp = 0;
for (i = 0; i != lengthof(_strings); i++) {
if (_strings[i] != NULL) {
- fprintf(out, next == i ? "\t%s,\n" : "\n\t%s = 0x%X,\n", _strings[i]->name, i);
+ if (next != i) fprintf(out, "\n");
+ fprintf(out, "static const StringID %s = 0x%X;\n", _strings[i]->name, i);
next = i + 1;
}
}
- fprintf(out, "};\n");
-
fprintf(out,
"\nenum {\n"
"\tLANGUAGE_PACK_IDENT = 0x474E414C, // Big Endian value for 'LANG' (LE is 0x 4C 41 4E 47)\n"
@@ -1039,6 +1040,8 @@ static void WriteStringsH(const char *filename)
"};\n", (uint)_hash
);
+ fprintf(out, "\n#endif /* TABLE_STRINGS_H */\n");
+
fclose(out);
if (CompareFiles("tmp.xxx", filename)) {