Skip to content

Commit

Permalink
Add explicit Haskell names to the #enum MDB_cursor_op
Browse files Browse the repository at this point in the history
This is a workaround for
haskell/hsc2hs#89, because
not having explicit Haskell names prevents
cross-compilation via ASM (for now).
  • Loading branch information
jorisdral committed Apr 5, 2024
1 parent a9b4099 commit 7df3e19
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## 0.4.0.1 — 2024-04-05

### Patch

* Add explicit Haskell names to the `#enum MDB_cursor_op`. This is a workaround
for https://github.com/haskell/hsc2hs/pull/89, because not having explicit
Haskell names prevents cross-compilation via ASM (for now).

## 0.4.0.0 — 2024-04-04

### Breaking
Expand Down
2 changes: 1 addition & 1 deletion cardano-lmdb.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 3.0
name: cardano-lmdb
version: 0.4.0.0
version: 0.4.0.1
synopsis: Lightning MDB bindings
category: Database
description:
Expand Down
2 changes: 1 addition & 1 deletion src/Database/LMDB/FFI.hsc
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ foreign import capi unsafe "lmdb.h value MDB_MULTIPLE" mdbMultiple :: CUInt

newtype MDB_cursor_op = MDB_cursor_op ( #type MDB_cursor_op )
deriving (Show, Eq)
#{enum MDB_cursor_op, MDB_cursor_op, MDB_FIRST, MDB_FIRST_DUP, MDB_GET_BOTH, MDB_GET_BOTH_RANGE, MDB_GET_CURRENT, MDB_GET_MULTIPLE, MDB_LAST, MDB_LAST_DUP, MDB_NEXT, MDB_NEXT_DUP, MDB_NEXT_MULTIPLE, MDB_NEXT_NODUP, MDB_PREV, MDB_PREV_DUP, MDB_PREV_NODUP, MDB_SET, MDB_SET_KEY, MDB_SET_RANGE}
#{enum MDB_cursor_op, MDB_cursor_op, mdbFirst = MDB_FIRST, mdbFirstDup = MDB_FIRST_DUP, mdbGetBoth = MDB_GET_BOTH, mdbGetBothRange = MDB_GET_BOTH_RANGE, mdbGetCurrent = MDB_GET_CURRENT, mdbGetMultiple = MDB_GET_MULTIPLE, mdbLast = MDB_LAST, mdbLastDup = MDB_LAST_DUP, mdbNext = MDB_NEXT, mdbNextDup = MDB_NEXT_DUP, mdbNextMultiple = MDB_NEXT_MULTIPLE, mdbNextNodup = MDB_NEXT_NODUP, mdbPrev = MDB_PREV, mdbPrevDup = MDB_PREV_DUP, mdbPrevNodup = MDB_PREV_NODUP, mdbSet = MDB_SET, mdbSetKey = MDB_SET_KEY, mdbSetRange = MDB_SET_RANGE}

instance Bounded MDB_cursor_op where
minBound = mdbFirst
Expand Down

0 comments on commit 7df3e19

Please sign in to comment.