Browse Source

Merge pull request #2619 from chfast/fix_evmjit_exports

Fix evmjit Windows exports
cl-refactor
Gav Wood 10 years ago
parent
commit
abe38d4efc
  1. 14
      evmjit/include/evmjit/JIT-c.h
  2. 6
      evmjit/libevmjit/JIT-c.cpp

14
evmjit/include/evmjit/JIT-c.h

@ -1,6 +1,14 @@
#include "stdint.h"
#ifdef _MSC_VER
#define EXPORT __declspec(dllexport)
#define _ALLOW_KEYWORD_MACROS
#define noexcept throw()
#else
#define EXPORT
#endif
#ifdef __cplusplus
extern "C" {
#endif
@ -51,11 +59,11 @@ typedef enum evmjit_return_code
typedef struct evmjit_context evmjit_context;
evmjit_context* evmjit_create(evmjit_runtime_data* _data, void* _env);
EXPORT evmjit_context* evmjit_create(evmjit_runtime_data* _data, void* _env);
evmjit_return_code evmjit_exec(evmjit_context* _context);
EXPORT evmjit_return_code evmjit_exec(evmjit_context* _context);
void evmjit_destroy(evmjit_context* _context);
EXPORT void evmjit_destroy(evmjit_context* _context);
inline char const* evmjit_get_output(evmjit_runtime_data* _data) { return _data->callData; }

6
evmjit/libevmjit/JIT-c.cpp

@ -6,7 +6,7 @@ extern "C"
{
using namespace dev::evmjit;
EXPORT evmjit_context* evmjit_create(evmjit_runtime_data* _data, void* _env)
evmjit_context* evmjit_create(evmjit_runtime_data* _data, void* _env)
{
auto data = reinterpret_cast<RuntimeData*>(_data);
auto env = reinterpret_cast<Env*>(_env);
@ -20,13 +20,13 @@ EXPORT evmjit_context* evmjit_create(evmjit_runtime_data* _data, void* _env)
return reinterpret_cast<evmjit_context*>(context);
}
EXPORT void evmjit_destroy(evmjit_context* _context)
void evmjit_destroy(evmjit_context* _context)
{
auto context = reinterpret_cast<ExecutionContext*>(_context);
delete context;
}
EXPORT evmjit_return_code evmjit_exec(evmjit_context* _context)
evmjit_return_code evmjit_exec(evmjit_context* _context)
{
auto context = reinterpret_cast<ExecutionContext*>(_context);

Loading…
Cancel
Save