From 81a64d68c7ce50617bac025061d8f6db91b00ee9 Mon Sep 17 00:00:00 2001 From: Ben Smith Date: Wed, 15 Mar 2017 16:29:37 -0700 Subject: Fix potential one-definition-rule breaking structs (#356) Context is the most common potential problem here, but I noticed that wasm-link.h had some others too (DataSegment and Export). These probably aren't an issue yet, since they all have trivial constructors. As soon as we add non-trivial types to these they break though. --- src/binary-reader-linker.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/binary-reader-linker.cc') diff --git a/src/binary-reader-linker.cc b/src/binary-reader-linker.cc index dc537259..5b3d36f8 100644 --- a/src/binary-reader-linker.cc +++ b/src/binary-reader-linker.cc @@ -22,6 +22,9 @@ #define RELOC_SIZE 5 namespace wabt { +namespace link { + +namespace { struct Context { LinkerInputBinary* binary; @@ -30,6 +33,8 @@ struct Context { Section* current_section; }; +} // namespace + static Result on_reloc_count(uint32_t count, BinarySection section_code, StringSlice section_name, @@ -334,4 +339,5 @@ Result read_binary_linker(LinkerInputBinary* input_info, &read_options); } +} // namespace link } // namespace wabt -- cgit v1.2.3