Skip to content

Commit

Permalink
add hostArch function to Chainweb.Utils
Browse files Browse the repository at this point in the history
  • Loading branch information
larskuhtz committed Aug 8, 2024
1 parent 164a4c9 commit 848bced
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/Chainweb/Utils.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE DefaultSignatures #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
Expand Down Expand Up @@ -214,6 +215,9 @@ module Chainweb.Utils
, showIpv6
, sockAddrJson

-- * GHC Host Architecture
, hostArch

-- * Debugging Tools
, estimateBlockHeight
, parseUtcTime
Expand Down Expand Up @@ -1389,6 +1393,18 @@ showIpv6 ha = T.intercalate ":"
where
(a0,a1,a2,a3,a4,a5,a6,a7) = hostAddress6ToTuple ha

-- -------------------------------------------------------------------------- --
-- GHC Host architecture

hostArch :: String
#if aarch64_HOST_ARCH == 1
hostArch = "aarch64"
#elif x86_64_HOST_ARCH == 1
hostArch = "x86_64"
#else
hostArch = "unknown"
#endif

-- -------------------------------------------------------------------------- --
-- Debugging Tools

Expand Down

0 comments on commit 848bced

Please sign in to comment.