[project @ 2004-12-15 12:51:15 by simonpj]
authorsimonpj <unknown>
Wed, 15 Dec 2004 12:51:16 +0000 (12:51 +0000)
committersimonpj <unknown>
Wed, 15 Dec 2004 12:51:16 +0000 (12:51 +0000)
Make ghc/lib/compat/Compat/Directory.hs use the C function
__compat_long_path_size, rather than
__hscore_long_path_size, as the libraries/ version does
And make ghc/lib/compat/cbits/directory.c define it.

In this way we avoid spurious duplicate-symbol errors when we
compile GHC with ghc6.2.1 etc.

ghc/lib/compat/Compat/Directory.hs
ghc/lib/compat/cbits/directory.c

index 12c9d94..60f372a 100644 (file)
@@ -57,7 +57,8 @@ foreign import stdcall unsafe "SHGetFolderPathA"
                               -> CString 
                               -> IO CInt
 
-foreign import ccall unsafe "__hscore_long_path_size"
+-- __compat_long_path_size defined in cbits/directory.c
+foreign import ccall unsafe "__compat_long_path_size"
   long_path_size :: Int
 
 foreign import ccall unsafe "__hscore_CSIDL_APPDATA"  csidl_APPDATA  :: CInt
index 713911b..af3810c 100644 (file)
@@ -24,9 +24,9 @@
  * (PATH_MAX is not defined on systems with unlimited path length,\r
  * e.g. the Hurd).\r
  */\r
-INLINE HsInt __hscore_long_path_size() { return PATH_MAX; }\r
+INLINE HsInt __compat_long_path_size() { return PATH_MAX; } \r
 #else\r
-INLINE HsInt __hscore_long_path_size() { return 4096; }\r
+INLINE HsInt __compat_long_path_size() { return 4096; }\r
 #endif\r
 \r
 #if defined(mingw32_TARGET_OS)\r