summaryrefslogtreecommitdiff
path: root/src/binary.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/binary.cc')
-rw-r--r--src/binary.cc24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/binary.cc b/src/binary.cc
index b0cd32a2..6e993ab6 100644
--- a/src/binary.cc
+++ b/src/binary.cc
@@ -18,10 +18,28 @@
namespace wabt {
-const char* g_section_name[] = {
-#define V(NAME, name, code) #NAME,
+BinarySectionOrder GetSectionOrder(BinarySection sec) {
+ switch (sec) {
+#define V(Name, name, code) \
+ case BinarySection::Name: \
+ return BinarySectionOrder::Name;
WABT_FOREACH_BINARY_SECTION(V)
#undef V
-};
+ default:
+ WABT_UNREACHABLE;
+ }
+}
+
+const char* GetSectionName(BinarySection sec) {
+ switch (sec) {
+#define V(Name, name, code) \
+ case BinarySection::Name: \
+ return #Name;
+ WABT_FOREACH_BINARY_SECTION(V)
+#undef V
+ default:
+ WABT_UNREACHABLE;
+ }
+}
} // namespace wabt