From 7df3e19cbbd6931cb0c4adc36a2a52c9568f146c Mon Sep 17 00:00:00 2001 From: Joris Dral Date: Fri, 5 Apr 2024 12:46:37 +0200 Subject: [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). --- CHANGELOG.md | 8 ++++++++ cardano-lmdb.cabal | 2 +- src/Database/LMDB/FFI.hsc | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fe7d88c..07fb97a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/cardano-lmdb.cabal b/cardano-lmdb.cabal index a6f6e3d..ea369e4 100644 --- a/cardano-lmdb.cabal +++ b/cardano-lmdb.cabal @@ -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: diff --git a/src/Database/LMDB/FFI.hsc b/src/Database/LMDB/FFI.hsc index c1e455e..9ec6c5c 100644 --- a/src/Database/LMDB/FFI.hsc +++ b/src/Database/LMDB/FFI.hsc @@ -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