Since __hscore_R_OK and friends are inline C, use correct .h location.
authorMalcolm.Wallace@cs.york.ac.uk <unknown>
Mon, 16 Mar 2009 11:38:15 +0000 (11:38 +0000)
committerMalcolm.Wallace@cs.york.ac.uk <unknown>
Mon, 16 Mar 2009 11:38:15 +0000 (11:38 +0000)
This patch just adds HsDirectory.h into the foreign imports of these
values.  Without it, nhc98 cannot generate correct interfacing code.

System/Directory.hs
include/HsDirectory.h

index 1f38b14..86e852f 100644 (file)
@@ -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
index 7f33f08..b74f069 100644 (file)
@@ -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__)