added compiler flag sentinels to vm2 headers

why:
  making sure that deep links into vm2 sources are configured properly. it
  is intended that only the vm_*.nim interface headers are allowed to
  source files in vm2. the sentinels just protect from coding errors.
This commit is contained in:
Jordan Hrycaj 2021-04-08 16:13:27 +01:00 committed by zah
parent b4f8450968
commit b7bf84a71f
12 changed files with 71 additions and 0 deletions

View File

@ -5,6 +5,11 @@
# * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
# at your option. This file may not be copied, modified, or distributed except according to those terms.
when not defined(vm2_enabled):
{.fatal: "Flags \"vm2_enabled\" must be defined"}
when defined(evmc_enabled):
{.fatal: "Flags \"evmc_enabled\" and \"vm2_enabled\" are mutually exclusive"}
import
chronicles, strformat, macros, options, times,
sets, eth/[common, keys],

View File

@ -8,6 +8,12 @@
# at your option. This file may not be copied, modified, or distributed except
# according to those terms.
when not defined(vm2_enabled):
{.fatal: "Flags \"vm2_enabled\" must be defined"}
when defined(evmc_enabled):
{.fatal: "Flags \"evmc_enabled\" and \"vm2_enabled\" are mutually exclusive"}
# see vm_opcode_value
import
./interpreter/opcode_values as vmo

View File

@ -5,6 +5,11 @@
# * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
# at your option. This file may not be copied, modified, or distributed except according to those terms.
when not defined(vm2_enabled):
{.fatal: "Flags \"vm2_enabled\" must be defined"}
when defined(evmc_enabled):
{.fatal: "Flags \"evmc_enabled\" and \"vm2_enabled\" are mutually exclusive"}
import
math, eth/common/eth_types,
./utils/[macros_gen_opcodes, utils_numeric],

View File

@ -5,6 +5,11 @@
# * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
# at your option. This file may not be copied, modified, or distributed except according to those terms.
when not defined(vm2_enabled):
{.fatal: "Flags \"vm2_enabled\" must be defined"}
when defined(evmc_enabled):
{.fatal: "Flags \"evmc_enabled\" and \"vm2_enabled\" are mutually exclusive"}
import ./utils/macros_gen_opcodes
fill_enum_holes:

View File

@ -5,6 +5,11 @@
# * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
# at your option. This file may not be copied, modified, or distributed except according to those terms.
when not defined(vm2_enabled):
{.fatal: "Flags \"vm2_enabled\" must be defined"}
when defined(evmc_enabled):
{.fatal: "Flags \"evmc_enabled\" and \"vm2_enabled\" are mutually exclusive"}
import
macros,
stew/endians2, stew/ranges/ptr_arith,

View File

@ -5,6 +5,11 @@
# * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
# at your option. This file may not be copied, modified, or distributed except according to those terms.
when not defined(vm2_enabled):
{.fatal: "Flags \"vm2_enabled\" must be defined"}
when defined(evmc_enabled):
{.fatal: "Flags \"evmc_enabled\" and \"vm2_enabled\" are mutually exclusive"}
import stint, eth/common/eth_types
type

View File

@ -5,6 +5,11 @@
# * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
# at your option. This file may not be copied, modified, or distributed except according to those terms.
when not defined(vm2_enabled):
{.fatal: "Flags \"vm2_enabled\" must be defined"}
when defined(evmc_enabled):
{.fatal: "Flags \"evmc_enabled\" and \"vm2_enabled\" are mutually exclusive"}
import
sequtils,
chronicles, eth/common/eth_types,

View File

@ -5,6 +5,11 @@
# * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
# at your option. This file may not be copied, modified, or distributed except according to those terms.
when not defined(vm2_enabled):
{.fatal: "Flags \"vm2_enabled\" must be defined"}
when defined(evmc_enabled):
{.fatal: "Flags \"evmc_enabled\" and \"vm2_enabled\" are mutually exclusive"}
import ./types
proc isCreate*(message: Message): bool =

View File

@ -1,3 +1,18 @@
# Nimbus
# Copyright (c) 2018 Status Research & Development GmbH
# Licensed under either of
# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or
# http://www.apache.org/licenses/LICENSE-2.0)
# * MIT license ([LICENSE-MIT](LICENSE-MIT) or
# http://opensource.org/licenses/MIT)
# at your option. This file may not be copied, modified, or distributed except
# according to those terms.
when not defined(vm2_enabled):
{.fatal: "Flags \"vm2_enabled\" must be defined"}
when defined(evmc_enabled):
{.fatal: "Flags \"evmc_enabled\" and \"vm2_enabled\" are mutually exclusive"}
import
./types,
./interpreter/[gas_meter, gas_costs, utils/utils_numeric, vm_forks],

View File

@ -8,6 +8,11 @@
# at your option. This file may not be copied, modified, or distributed except
# according to those terms.
when not defined(vm2_enabled):
{.fatal: "Flags \"vm2_enabled\" must be defined"}
when defined(evmc_enabled):
{.fatal: "Flags \"evmc_enabled\" and \"vm2_enabled\" are mutually exclusive"}
import
macros, strformat, tables, sets, options,
eth/[common, keys, rlp], nimcrypto/keccak,

View File

@ -5,6 +5,11 @@
# * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
# at your option. This file may not be copied, modified, or distributed except according to those terms.
when not defined(vm2_enabled):
{.fatal: "Flags \"vm2_enabled\" must be defined"}
when defined(evmc_enabled):
{.fatal: "Flags \"evmc_enabled\" and \"vm2_enabled\" are mutually exclusive"}
import
options, sets,
eth/common, chronicles, ../db/accounts_cache,

View File

@ -8,6 +8,11 @@
# at your option. This file may not be copied, modified, or distributed except
# according to those terms.
when not defined(vm2_enabled):
{.fatal: "Flags \"vm2_enabled\" must be defined"}
when defined(evmc_enabled):
{.fatal: "Flags \"evmc_enabled\" and \"vm2_enabled\" are mutually exclusive"}
import
tables, eth/common,
options, json, sets,