diff options
author | Joey Hess <joeyh@joeyh.name> | 2016-03-08 02:45:10 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2016-03-08 02:45:10 -0400 |
commit | 2e498e292d4cbbf3ccdb31d3e5a1e9bc09a44cc2 (patch) | |
tree | 9af54bd521ec78a9ed730cec727197b437e435b2 /Utility | |
parent | 50c190aaa5612df07c342a2baa28e718c5a46552 (diff) |
build without disk-free-space on android
Diffstat (limited to 'Utility')
-rw-r--r-- | Utility/DiskFree.hs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Utility/DiskFree.hs b/Utility/DiskFree.hs index fe3a4577c..be4e82355 100644 --- a/Utility/DiskFree.hs +++ b/Utility/DiskFree.hs @@ -6,12 +6,15 @@ -} {-# OPTIONS_GHC -fno-warn-tabs #-} +{-# LANGUAGE CPP #-} module Utility.DiskFree ( getDiskFree, getDiskSize ) where +#ifndef __ANDROID__ + import System.DiskSpace import Utility.Applicative import Utility.Exception @@ -21,3 +24,15 @@ getDiskFree = catchMaybeIO . getAvailSpace getDiskSize :: FilePath -> IO (Maybe Integer) getDiskSize = fmap diskTotal <$$> catchMaybeIO . getDiskUsage + +#else + +#warning Building without disk free space checking support + +getDiskFree :: FilePath -> IO (Maybe Integer) +getDiskFree _ = return Nothing + +getDiskSize :: FilePath -> IO (Maybe Integer) +getDiskSize _ = return Nothing + +#endif |