Skip to content

Commit

Permalink
Merge pull request #1807 from AntelopeIO/c++17_isolate
Browse files Browse the repository at this point in the history
Avoid including `eos-vm-oc.hpp` which includes `types.hpp`, so the c++17 compilation doesn't propagate throughout
  • Loading branch information
greg7mdp authored Oct 23, 2023
2 parents de3756a + 87cbe09 commit 59bf674
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
#ifdef __cplusplus
#include <vector>
#include <list>
namespace eosio { namespace chain {class apply_context;}}
namespace eosio::chain {
class apply_context;
}
#endif

struct eos_vm_oc_control_block {
Expand Down Expand Up @@ -38,3 +40,9 @@ struct eos_vm_oc_control_block {
int64_t max_linear_memory_pages;
void* globals;
};

#ifdef __cplusplus
namespace eosio::chain::eosvmoc {
using control_block = eos_vm_oc_control_block;
}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,7 @@
#include <vector>
#include <list>

namespace eosio { namespace chain {

class apply_context;

namespace eosvmoc {

using control_block = eos_vm_oc_control_block;
namespace eosio::chain::eosvmoc {

struct no_offset{};
struct code_offset {
Expand Down Expand Up @@ -52,7 +46,7 @@ enum eosvmoc_exitcode : int {

static constexpr uint8_t current_codegen_version = 1;

}}}
}

FC_REFLECT(eosio::chain::eosvmoc::no_offset, );
FC_REFLECT(eosio::chain::eosvmoc::code_offset, (offset));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
#pragma once
#include <fc/exception/exception.hpp>

#include <eosio/chain/wasm_eosio_constraints.hpp>
#include <eosio/chain/webassembly/eos-vm-oc/eos-vm-oc.hpp>
#include <eosio/chain/webassembly/eos-vm-oc/eos-vm-oc.h>
#include <eosio/chain/webassembly/eos-vm-oc/intrinsic_mapping.hpp>
#include <eosio/chain/webassembly/eos-vm-oc/gs_seg_helpers.h>

#include <stdint.h>
#include <stddef.h>

namespace eosio { namespace chain { namespace eosvmoc {
namespace eosio::chain::eosvmoc {

class memory {
static constexpr uint64_t intrinsic_count = intrinsic_table_size();
Expand Down Expand Up @@ -66,7 +67,7 @@ class memory {
uint8_t* fullpage_base;
};

}}}
}

#define OFFSET_OF_CONTROL_BLOCK_MEMBER(M) (-(int)eosio::chain::eosvmoc::memory::cb_offset + (int)offsetof(eosio::chain::eosvmoc::control_block, M))
#define OFFSET_OF_FIRST_INTRINSIC ((int)-eosio::chain::eosvmoc::memory::first_intrinsic_offset)

0 comments on commit 59bf674

Please sign in to comment.