Opt in for 32bit platforms (#44)

This commit is contained in:
Sergey Pepyakin 2018-02-09 11:20:21 +03:00 committed by Nikolay Volf
parent c0ed715b37
commit 6e4bbb7490
2 changed files with 16 additions and 4 deletions

View File

@ -14,3 +14,9 @@ byteorder = "1.0"
[dev-dependencies]
wabt = "0.1.2"
[features]
# 32-bit platforms are not supported and not tested. Use this flag if you really want to use
# wasmi on these platforms.
# See https://github.com/pepyakin/wasmi/issues/43
32bit_opt_in = []

View File

@ -101,6 +101,12 @@ extern crate wabt;
extern crate parity_wasm;
extern crate byteorder;
#[cfg(all(not(feature = "32bit_opt_in"), target_pointer_width = "32"))]
compile_error! {"32-bit targets are not supported at the moment.
You can use '32bit_opt_in' feature.
See https://github.com/pepyakin/wasmi/issues/43"
}
use std::fmt;
use std::error;
use std::collections::HashMap;
@ -127,9 +133,9 @@ impl Trap {
}
/// Error type which can thrown by wasm code or by host environment.
///
///
/// See [`Trap`] for details.
///
///
/// [`Trap`]: struct.Trap.html
#[derive(Debug)]
pub enum TrapKind {
@ -231,9 +237,9 @@ pub enum Error {
impl Error {
/// Returns [`HostError`] if this `Error` represents some host error.
///
///
/// I.e. if this error have variant [`Host`] or [`Trap`][`Trap`] with [host][`TrapKind::Host`] error.
///
///
/// [`HostError`]: trait.HostError.html
/// [`Host`]: enum.Error.html#variant.Host
/// [`Trap`]: enum.Error.html#variant.Trap