From 090c5cd83b75f5de460d8d90707207f57f977f72 Mon Sep 17 00:00:00 2001 From: Christian Flach Date: Mon, 8 Mar 2021 19:21:36 +0100 Subject: [PATCH] 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). --- tools/pioasm/c_sdk_output.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/pioasm/c_sdk_output.cpp b/tools/pioasm/c_sdk_output.cpp index 9e2dc22..9388c0d 100644 --- a/tools/pioasm/c_sdk_output.cpp +++ b/tools/pioasm/c_sdk_output.cpp @@ -68,6 +68,8 @@ struct c_sdk_output : public output_format { header(out, "This file is autogenerated by pioasm; do not edit!"); + fprintf(out, "#pragma once\n"); + fprintf(out, "\n"); fprintf(out, "#if !PICO_NO_HARDWARE\n"); fprintf(out, "#include \"hardware/pio.h\"\n"); fprintf(out, "#endif\n");