summaryrefslogtreecommitdiff
path: root/src/tools/wasm2c.cc
diff options
context:
space:
mode:
authorBen Smith <binjimin@gmail.com>2018-08-03 12:28:01 -0700
committerGitHub <noreply@github.com>2018-08-03 12:28:01 -0700
commit407ed441bcc2e316c02e407e81e7aed41000578f (patch)
treec28e421b34184be3901481d956404b9ba9d7abcb /src/tools/wasm2c.cc
parent7ce1b98bec018c13b5c8e3875688bed43f1f2935 (diff)
downloadwabt-407ed441bcc2e316c02e407e81e7aed41000578f.tar.gz
wabt-407ed441bcc2e316c02e407e81e7aed41000578f.tar.bz2
wabt-407ed441bcc2e316c02e407e81e7aed41000578f.zip
Update testsuite; enable mut. globals by default (#884)
The newest testsuite update enables mutable globals by default, which matches the v1 WebAssembly spec. This change changes the default for all wabt tools, and changes the flag to `--disable-mutable-globals` in case you need the previous behavior. This flag will likely be removed in the future.
Diffstat (limited to 'src/tools/wasm2c.cc')
-rw-r--r--src/tools/wasm2c.cc13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/tools/wasm2c.cc b/src/tools/wasm2c.cc
index cf6e4eec..0d6654cb 100644
--- a/src/tools/wasm2c.cc
+++ b/src/tools/wasm2c.cc
@@ -80,15 +80,16 @@ static void ParseOptions(int argc, char** argv) {
});
parser.Parse(argc, argv);
- // TODO(binji): currently wasm2c doesn't support any feature flags.
- bool any_feature_enabled = false;
-#define WABT_FEATURE(variable, flag, help) \
- any_feature_enabled |= s_features.variable##_enabled();
+ // TODO(binji): currently wasm2c doesn't support any non-default feature
+ // flags.
+ bool any_non_default_feature = false;
+#define WABT_FEATURE(variable, flag, default_, help) \
+ any_non_default_feature |= (s_features.variable##_enabled() != default_);
#include "src/feature.def"
#undef WABT_FEATURE
- if (any_feature_enabled) {
- fprintf(stderr, "wasm2c doesn't currently support any --enable-* flags.\n");
+ if (any_non_default_feature) {
+ fprintf(stderr, "wasm2c currently support only default feature flags.\n");
exit(1);
}
}