From ab3e6dbac144c63bde23c833c7bfb99097130732 Mon Sep 17 00:00:00 2001 From: simonpj Date: Wed, 15 Dec 2004 12:51:16 +0000 Subject: [PATCH] [project @ 2004-12-15 12:51:15 by simonpj] 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 | 3 ++- ghc/lib/compat/cbits/directory.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ghc/lib/compat/Compat/Directory.hs b/ghc/lib/compat/Compat/Directory.hs index 12c9d94..60f372a 100644 --- a/ghc/lib/compat/Compat/Directory.hs +++ b/ghc/lib/compat/Compat/Directory.hs @@ -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 diff --git a/ghc/lib/compat/cbits/directory.c b/ghc/lib/compat/cbits/directory.c index 713911b..af3810c 100644 --- a/ghc/lib/compat/cbits/directory.c +++ b/ghc/lib/compat/cbits/directory.c @@ -24,9 +24,9 @@ * (PATH_MAX is not defined on systems with unlimited path length, * e.g. the Hurd). */ -INLINE HsInt __hscore_long_path_size() { return PATH_MAX; } +INLINE HsInt __compat_long_path_size() { return PATH_MAX; } #else -INLINE HsInt __hscore_long_path_size() { return 4096; } +INLINE HsInt __compat_long_path_size() { return 4096; } #endif #if defined(mingw32_TARGET_OS) -- 1.7.10.4