diff --git a/evmjit/include/evmjit/JIT-c.h b/evmjit/include/evmjit/JIT-c.h index a92b29090..d7c792451 100644 --- a/evmjit/include/evmjit/JIT-c.h +++ b/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; } diff --git a/evmjit/libevmjit/JIT-c.cpp b/evmjit/libevmjit/JIT-c.cpp index 2fd578108..7c5cd0b14 100644 --- a/evmjit/libevmjit/JIT-c.cpp +++ b/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(_data); auto env = reinterpret_cast(_env); @@ -20,13 +20,13 @@ EXPORT evmjit_context* evmjit_create(evmjit_runtime_data* _data, void* _env) return reinterpret_cast(context); } -EXPORT void evmjit_destroy(evmjit_context* _context) +void evmjit_destroy(evmjit_context* _context) { auto context = reinterpret_cast(_context); delete context; } -EXPORT evmjit_return_code evmjit_exec(evmjit_context* _context) +evmjit_return_code evmjit_exec(evmjit_context* _context) { auto context = reinterpret_cast(_context);