summaryrefslogtreecommitdiff
path: root/lib/Data/Packed/Internal/Common.hs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Data/Packed/Internal/Common.hs')
-rw-r--r--lib/Data/Packed/Internal/Common.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Data/Packed/Internal/Common.hs b/lib/Data/Packed/Internal/Common.hs
index 3609bc2..bce9922 100644
--- a/lib/Data/Packed/Internal/Common.hs
+++ b/lib/Data/Packed/Internal/Common.hs
@@ -80,9 +80,14 @@ errorCode 2006 = "the input matrix is not positive definite"
80errorCode 2007 = "not yet supported in this OS" 80errorCode 2007 = "not yet supported in this OS"
81errorCode n = "code "++show n 81errorCode n = "code "++show n
82 82
83
84-- | clear the fpu
85foreign import ccall "auxi.h asm_finit" finit :: IO ()
86
83-- | check the error code 87-- | check the error code
84check :: String -> IO CInt -> IO () 88check :: String -> IO CInt -> IO ()
85check msg f = do 89check msg f = do
90 finit
86 err <- f 91 err <- f
87 when (err/=0) $ if err > 1024 92 when (err/=0) $ if err > 1024
88 then (error (msg++": "++errorCode err)) -- our errors 93 then (error (msg++": "++errorCode err)) -- our errors