From: Malcolm.Wallace@cs.york.ac.uk Date: Mon, 16 Mar 2009 11:38:15 +0000 (+0000) Subject: Since __hscore_R_OK and friends are inline C, use correct .h location. X-Git-Tag: 2009-06-25~9 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=6c7b6c450f8a8a3f60ff124742f0c421742406f2;p=haskell-directory.git Since __hscore_R_OK and friends are inline C, use correct .h location. This patch just adds HsDirectory.h into the foreign imports of these values. Without it, nhc98 cannot generate correct interfacing code. --- diff --git a/System/Directory.hs b/System/Directory.hs index 1f38b14..86e852f 100644 --- a/System/Directory.hs +++ b/System/Directory.hs @@ -916,13 +916,13 @@ fileNameEndClean :: String -> String fileNameEndClean name = if isDrive name then addTrailingPathSeparator name else dropTrailingPathSeparator name -foreign import ccall unsafe "__hscore_R_OK" r_OK :: CInt -foreign import ccall unsafe "__hscore_W_OK" w_OK :: CInt -foreign import ccall unsafe "__hscore_X_OK" x_OK :: CInt +foreign import ccall unsafe "HsDirectory.h __hscore_R_OK" r_OK :: CInt +foreign import ccall unsafe "HsDirectory.h __hscore_W_OK" w_OK :: CInt +foreign import ccall unsafe "HsDirectory.h __hscore_X_OK" x_OK :: CInt -foreign import ccall unsafe "__hscore_S_IRUSR" s_IRUSR :: CMode -foreign import ccall unsafe "__hscore_S_IWUSR" s_IWUSR :: CMode -foreign import ccall unsafe "__hscore_S_IXUSR" s_IXUSR :: CMode +foreign import ccall unsafe "HsDirectory.h __hscore_S_IRUSR" s_IRUSR :: CMode +foreign import ccall unsafe "HsDirectory.h __hscore_S_IWUSR" s_IWUSR :: CMode +foreign import ccall unsafe "HsDirectory.h __hscore_S_IXUSR" s_IXUSR :: CMode #ifdef mingw32_HOST_OS foreign import ccall unsafe "__hscore_S_IFDIR" s_IFDIR :: CMode #endif diff --git a/include/HsDirectory.h b/include/HsDirectory.h index 7f33f08..b74f069 100644 --- a/include/HsDirectory.h +++ b/include/HsDirectory.h @@ -69,7 +69,6 @@ INLINE HsInt __hscore_long_path_size() { #endif } -#ifdef __GLASGOW_HASKELL__ INLINE int __hscore_R_OK() { return R_OK; } INLINE int __hscore_W_OK() { return W_OK; } INLINE int __hscore_X_OK() { return X_OK; } @@ -78,7 +77,6 @@ INLINE mode_t __hscore_S_IRUSR() { return S_IRUSR; } INLINE mode_t __hscore_S_IWUSR() { return S_IWUSR; } INLINE mode_t __hscore_S_IXUSR() { return S_IXUSR; } INLINE mode_t __hscore_S_IFDIR() { return S_IFDIR; } -#endif #if defined(__MINGW32__)