summaryrefslogtreecommitdiff
path: root/src/wasm-binary.h
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-04-20 08:24:59 -0700
committerAlon Zakai <alonzakai@gmail.com>2016-04-20 08:24:59 -0700
commit86154bff23044b24e18235c8c92721eb463e616a (patch)
treee430db5de044492eb924df461a2abef95e6e7010 /src/wasm-binary.h
parent31dd39afd6197743d3ccbb2cfa4276134c6751d2 (diff)
parent589fb94100c02f8a6e6e923b73d5f7e578fe978a (diff)
downloadbinaryen-86154bff23044b24e18235c8c92721eb463e616a.tar.gz
binaryen-86154bff23044b24e18235c8c92721eb463e616a.tar.bz2
binaryen-86154bff23044b24e18235c8c92721eb463e616a.zip
Merge pull request #368 from WebAssembly/zero_x_b
0xb updates
Diffstat (limited to 'src/wasm-binary.h')
-rw-r--r--src/wasm-binary.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/wasm-binary.h b/src/wasm-binary.h
index 0630c0234..8fed9f6d9 100644
--- a/src/wasm-binary.h
+++ b/src/wasm-binary.h
@@ -215,6 +215,11 @@ public:
namespace BinaryConsts {
+enum Meta {
+ Magic = 0x6d736100,
+ Version = 11
+};
+
namespace Section {
auto Memory = "memory";
auto Signatures = "type";
@@ -477,8 +482,8 @@ public:
void writeHeader() {
if (debug) std::cerr << "== writeHeader" << std::endl;
- o << int32_t(0x6d736100); // magic number \0asm
- o << int32_t(10); // version number
+ o << int32_t(BinaryConsts::Magic); // magic number \0asm
+ o << int32_t(BinaryConsts::Version);
}
int32_t writeU32LEBPlaceholder() {
@@ -1325,8 +1330,8 @@ public:
void readHeader() {
if (debug) std::cerr << "== readHeader" << std::endl;
- verifyInt32(0x6d736100);
- verifyInt32(10);
+ verifyInt32(BinaryConsts::Magic);
+ verifyInt32(BinaryConsts::Version);
}
void readStart() {