From: Evan Hunt Date: Wed, 13 Oct 2021 07:48:19 +0000 (-0700) Subject: Use "pragma once" in automatically generated header files X-Git-Tag: v9.17.20~52^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=31825521b08f52a1f9cb54514dd62e7872200f3a;p=thirdparty%2Fbind9.git Use "pragma once" in automatically generated header files Files created by gen.c were still using old-style include guards. --- diff --git a/lib/dns/gen.c b/lib/dns/gen.c index 09b877e6ff2..6e65310df77 100644 --- a/lib/dns/gen.c +++ b/lib/dns/gen.c @@ -700,8 +700,7 @@ main(int argc, char **argv) { } if (code) { - printf("#ifndef DNS_CODE_H\n"); - printf("#define DNS_CODE_H 1\n\n"); + printf("#pragma once\n"); printf("#include \n"); printf("#include \n\n"); @@ -868,13 +867,10 @@ main(int argc, char **argv) { i, upper(ttn->typebuf)); } printf("\t}\n"); - - printf("#endif /* DNS_CODE_H */\n"); } else if (type_enum) { char *s; - printf("#ifndef DNS_ENUMTYPE_H\n"); - printf("#define DNS_ENUMTYPE_H 1\n\n"); + printf("#pragma once\n"); printf("enum {\n"); printf("\tdns_rdatatype_none = 0,\n"); @@ -919,14 +915,11 @@ main(int argc, char **argv) { "((dns_rdatatype_t)dns_rdatatype_maila)\n"); printf("#define dns_rdatatype_any\t" "((dns_rdatatype_t)dns_rdatatype_any)\n"); - - printf("\n#endif /* DNS_ENUMTYPE_H */\n"); } else if (class_enum) { char *s; int classnum; - printf("#ifndef DNS_ENUMCLASS_H\n"); - printf("#define DNS_ENUMCLASS_H 1\n\n"); + printf("#pragma once\n"); printf("enum {\n"); @@ -957,7 +950,6 @@ main(int argc, char **argv) { #undef PRINTCLASS printf("};\n\n"); - printf("#endif /* DNS_ENUMCLASS_H */\n"); } else if (structs) { if (prefix != NULL) { if ((fd = fopen(prefix, "r")) != NULL) {