Skip to content

Commit

Permalink
Start re-enabling some extern functions for Bun FFI
Browse files Browse the repository at this point in the history
  • Loading branch information
kriszyp committed May 10, 2022
1 parent 5d8ce4f commit 08f113a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/dbi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
Expand Down
6 changes: 6 additions & 0 deletions src/lmdb-js.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <windows.h>
#else
Expand Down

0 comments on commit 08f113a

Please sign in to comment.