Skip to content

Commit

Permalink
Properly safe guard newer flag for older builds, #164
Browse files Browse the repository at this point in the history
  • Loading branch information
kriszyp committed Sep 4, 2023
1 parent aafec80 commit 0418843
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,11 @@ void do_read(napi_env nenv, void* instruction_pointer) {
*instruction = rc;
unsigned int env_flags = 0;
mdb_env_get_flags(env, &env_flags);
if (data.mv_size > 4096 && !(env_flags & MDB_REMAP_CHUNKS)) {
if (data.mv_size > 4096
#ifdef MDB_RPAGE_CACHE
&& !(env_flags & MDB_REMAP_CHUNKS)
#endif
) {
EnvWrap::toSharedBuffer(env, instruction, data);
*((double*)instruction) = (double) (size_t) data.mv_data;
} else {
Expand Down

0 comments on commit 0418843

Please sign in to comment.