Skip to content

Commit

Permalink
lmdb: hack to avoid windows compilation error involving mdb_filehandle_t
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bmatsuo committed Nov 12, 2015
1 parent 933fde9 commit cb539ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lmdb/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cb539ff

Please sign in to comment.