Skip to content

Commit e62dd79

Browse files
author
VictorTaelin
committed
compiled mode: strip '#pragma once' from embedded Runtime.h to silence clang warning in generated TU
1 parent 052c7b8 commit e62dd79

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/HVM/Compile.hs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,13 @@ rt_red_opy_w32 :: String; rt_red_opy_w32 = $(embedStringFile "./src/HVM/runtime/
7070
stripIncl :: String -> String
7171
stripIncl = unlines . filter (not . isPrefixOf "#include \"Runtime.h\"") . lines
7272

73+
-- Remove header-only pragmas that are noisy in a main TU
74+
stripHdr :: String -> String
75+
stripHdr = unlines . filter (not . isPrefixOf "#pragma once") . lines
76+
7377
runtime_c :: String
7478
runtime_c = unlines
75-
[ runtime_h
79+
[ stripHdr runtime_h
7680
, stripIncl rt_state_c
7781
, stripIncl rt_heap_c
7882
, stripIncl rt_term_c

0 commit comments

Comments
 (0)