From cb539ffc879d8a6a6398bc9620bf0680598c918a Mon Sep 17 00:00:00 2001 From: Bryan Matsuo Date: Thu, 12 Nov 2015 01:46:30 -0800 Subject: [PATCH] lmdb: hack to avoid windows compilation error involving mdb_filehandle_t Relates to #33 The type is a pointer on Windows and comparing a pointer to the value -1 is non-trivial in Go. The comparison has been replaced with a concise but delicate hack that is untested as of yet. --- lmdb/env.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lmdb/env.go b/lmdb/env.go index d718dc1d..70fc5ff2 100644 --- a/lmdb/env.go +++ b/lmdb/env.go @@ -102,7 +102,7 @@ func (env *Env) FD() (uintptr, error) { if err != nil { return 0, err } - if mf == C.mdb_filehandle_t(-1) { + if uintptr(mf) == ^uintptr(0) { return 0, errNotOpen } return uintptr(mf), nil