We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e5fa6b7 commit f8970d9Copy full SHA for f8970d9
src/libclang/preprocessor.cpp
@@ -1089,6 +1089,11 @@ detail::preprocessor_output detail::preprocess(const libclang_compile_config& co
1089
else
1090
xpath += *cpath;
1091
1092
+ // We strip all conditional defines and pragmas from the input, which includes the include
1093
+ // guard. If the source includes a file, which includes itself again (for some reason), this
1094
+ // leads to a duplicate include, as we no longer have an include guard. So we manually add one.
1095
+ result.source += "#pragma once\n\n";
1096
+
1097
position p(ts::ref(result.source), preprocessed.file.c_str());
1098
ts::flag in_string(false), in_char(false), first_line(true);
1099
while (p)
0 commit comments