mirror of https://github.com/status-im/evmc.git
examples: Add header for example Precompiles VM
This commit is contained in:
parent
ef52f2954a
commit
206eb71c9e
|
@ -2,7 +2,7 @@
|
|||
# Copyright 2019 The EVMC Authors.
|
||||
# Licensed under the Apache License, Version 2.0.
|
||||
|
||||
add_library(example-precompiles-vm SHARED example_precompiles_vm.cpp)
|
||||
add_library(example-precompiles-vm SHARED example_precompiles_vm.cpp example_precompiles_vm.h)
|
||||
add_library(evmc::example-precompiles-vm ALIAS example-precompiles-vm)
|
||||
target_link_libraries(example-precompiles-vm PRIVATE evmc)
|
||||
|
||||
|
|
|
@ -3,8 +3,7 @@
|
|||
* Licensed under the Apache License, Version 2.0.
|
||||
*/
|
||||
|
||||
#include <evmc/evmc.h>
|
||||
#include <evmc/utils.h>
|
||||
#include "example_precompiles_vm.h"
|
||||
#include <algorithm>
|
||||
|
||||
static evmc_result execute_identity(const evmc_message* msg)
|
||||
|
@ -112,7 +111,7 @@ static evmc_result execute(evmc_vm* /*unused*/,
|
|||
}
|
||||
}
|
||||
|
||||
extern "C" EVMC_EXPORT evmc_vm* evmc_create_example_precompiles_vm()
|
||||
evmc_vm* evmc_create_example_precompiles_vm()
|
||||
{
|
||||
static struct evmc_vm vm = {
|
||||
EVMC_ABI_VERSION,
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
/* EVMC: Ethereum Client-VM Connector API.
|
||||
* Copyright 2019 The EVMC Authors.
|
||||
* Licensed under the Apache License, Version 2.0.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <evmc/evmc.h>
|
||||
#include <evmc/utils.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Creates EVMC Example Precompiles VM.
|
||||
*/
|
||||
EVMC_EXPORT struct evmc_vm* evmc_create_example_precompiles_vm(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
Loading…
Reference in New Issue