From c1d039e90542be51402b61db92ce52725bae19ad Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 12 Mar 2013 05:48:41 -0400 Subject: got hdevtools working on the git-annex source tree --- Utility/DiskFree.hs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'Utility') diff --git a/Utility/DiskFree.hs b/Utility/DiskFree.hs index 453244175..20911dd06 100644 --- a/Utility/DiskFree.hs +++ b/Utility/DiskFree.hs @@ -5,7 +5,7 @@ - Licensed under the GNU GPL version 3 or higher. -} -{-# LANGUAGE ForeignFunctionInterface #-} +{-# LANGUAGE ForeignFunctionInterface, CPP #-} module Utility.DiskFree ( getDiskFree ) where @@ -15,6 +15,8 @@ import Foreign.C.Types import Foreign.C.String import Foreign.C.Error +#ifdef WITH_CLIBS + foreign import ccall safe "libdiskfree.h diskfree" c_diskfree :: CString -> IO CULLong @@ -27,3 +29,10 @@ getDiskFree path = withFilePath path $ \c_path -> do ) where safeErrno (Errno v) = v == 0 + +#else + +getDiskFree :: FilePath -> IO (Maybe Integer) +getDiskFree _ = return Nothing + +#endif -- cgit v1.2.3