1 /* 2 * Copyright 2016 WebAssembly Community Group participants 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #include "src/binary.h" 18 19 namespace wabt { 20 GetSectionOrder(BinarySection sec)21BinarySectionOrder GetSectionOrder(BinarySection sec) { 22 switch (sec) { 23 #define V(Name, name, code) \ 24 case BinarySection::Name: \ 25 return BinarySectionOrder::Name; 26 WABT_FOREACH_BINARY_SECTION(V) 27 #undef V 28 default: 29 WABT_UNREACHABLE; 30 } 31 } 32 GetSectionName(BinarySection sec)33const char* GetSectionName(BinarySection sec) { 34 switch (sec) { 35 #define V(Name, name, code) \ 36 case BinarySection::Name: \ 37 return #Name; 38 WABT_FOREACH_BINARY_SECTION(V) 39 #undef V 40 default: 41 WABT_UNREACHABLE; 42 } 43 } 44 45 } // namespace wabt 46