diff --git a/src/dbi.cpp b/src/dbi.cpp index bb5d28261..975b8009b 100644 --- a/src/dbi.cpp +++ b/src/dbi.cpp @@ -172,6 +172,12 @@ NAPI_FUNCTION(getByBinary) { GET_UINT32_ARG(keySize, 1); RETURN_INT32(dw->doGetByBinary(keySize)); } + +extern "C" EXTERN uint32_t dbiGetByBinary(double dwPointer, uint32_t keySize) { + DbiWrap* dw = (DbiWrap*) (size_t) dwPointer; + return dw->doGetByBinary(keySize); +} + napi_finalize noopDbi = [](napi_env, void *, void *) { // Data belongs to LMDB, we shouldn't free it here }; diff --git a/src/lmdb-js.h b/src/lmdb-js.h index 3012c2d46..9c8d3a0d8 100644 --- a/src/lmdb-js.h +++ b/src/lmdb-js.h @@ -40,6 +40,12 @@ using namespace Napi; #ifndef __CPTHREAD_H__ #define __CPTHREAD_H__ +#ifdef _WIN32 +#define EXTERN __declspec(dllexport) +# else +#define EXTERN __attribute__((visibility("default"))) +#endif + #ifdef _WIN32 # include #else