summaryrefslogtreecommitdiff
path: root/src/common.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/common.h')
-rw-r--r--src/common.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/common.h b/src/common.h
index 0d7fa7b5..67cc7320 100644
--- a/src/common.h
+++ b/src/common.h
@@ -102,6 +102,11 @@ struct v128 {
namespace wabt {
+enum class ErrorLevel {
+ Warning,
+ Error,
+};
+
typedef uint32_t Index; // An index into one of the many index spaces.
typedef uint32_t Address; // An address or size in linear memory.
typedef size_t Offset; // An offset into a host's file or memory buffer.
@@ -351,6 +356,18 @@ static WABT_INLINE const char* GetTypeName(Type type) {
WABT_UNREACHABLE;
}
+/* error level */
+
+static WABT_INLINE const char* GetErrorLevelName(ErrorLevel error_level) {
+ switch (error_level) {
+ case ErrorLevel::Warning:
+ return "warning";
+ case ErrorLevel::Error:
+ return "error";
+ }
+ WABT_UNREACHABLE;
+}
+
template <typename T>
void ConvertBackslashToSlash(T begin, T end) {
std::replace(begin, end, '\\', '/');