commit 8c96d4b20db360bc9820bc80296206ba390aa6ee
parent 6ec173e105b5fae871fb8a8557cc4b4330f32542
Author: Jared Tobin <jared@jtobin.io>
Date: Sun, 28 Dec 2025 12:07:49 -0330
lib: use CPP to enforce 64-bit constraint
I'd previously used a conditional in the cabal file, but this doesn't play
so well with cabal2nix.
Diffstat:
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/lib/Crypto/Curve/Secp256k1.hs b/lib/Crypto/Curve/Secp256k1.hs
@@ -1,5 +1,6 @@
{-# OPTIONS_HADDOCK prune #-}
{-# LANGUAGE BangPatterns #-}
+{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE LambdaCase #-}
@@ -10,6 +11,11 @@
{-# LANGUAGE UnboxedTuples #-}
{-# LANGUAGE ViewPatterns #-}
+#include "MachDeps.h"
+#if WORD_SIZE_IN_BITS != 64
+#error "ppad-secp256k1 requires a 64-bit architecture"
+#endif
+
-- |
-- Module: Crypto.Curve.Secp256k1
-- Copyright: (c) 2024 Jared Tobin
diff --git a/ppad-secp256k1.cabal b/ppad-secp256k1.cabal
@@ -26,8 +26,6 @@ source-repository head
library
default-language: Haskell2010
- if !(arch(x86_64) || arch(aarch64))
- buildable: False
hs-source-dirs: lib
ghc-options:
-Wall