Skip to content

Commit 753b81e

Browse files
cmfcmfkilograham
authored andcommitted
pio: Add 'pragma once' to generated header files (#237)
We can't really use traditional include guards, because the header file may be piped to stdout (which means we might not have a file name).
1 parent e87a63d commit 753b81e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tools/pioasm/c_sdk_output.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ struct c_sdk_output : public output_format {
6868

6969
header(out, "This file is autogenerated by pioasm; do not edit!");
7070

71+
fprintf(out, "#pragma once\n");
72+
fprintf(out, "\n");
7173
fprintf(out, "#if !PICO_NO_HARDWARE\n");
7274
fprintf(out, "#include \"hardware/pio.h\"\n");
7375
fprintf(out, "#endif\n");

0 commit comments

Comments
 (0)