X-Git-Url: http://git.megacz.com/?p=haskell-directory.git;a=blobdiff_plain;f=include%2FHsDirectory.h;h=7185dc8cc5ab30677435cbfd80a04ec15643d17f;hp=83d7ed9fb914b5b96c37f82729f4ec6562496ee2;hb=50661a379e7edffada24ffee307321cb9edfb917;hpb=04e4add21624c6d35fe5510c426307839144ce6a diff --git a/include/HsDirectory.h b/include/HsDirectory.h index 83d7ed9..7185dc8 100644 --- a/include/HsDirectory.h +++ b/include/HsDirectory.h @@ -10,6 +10,12 @@ #define __HSDIRECTORY_H__ #include "HsDirectoryConfig.h" +// Otherwise these clash with similar definitions from other packages: +#undef PACKAGE_BUGREPORT +#undef PACKAGE_NAME +#undef PACKAGE_STRING +#undef PACKAGE_TARNAME +#undef PACKAGE_VERSION #if HAVE_SYS_TYPES_H #include @@ -23,6 +29,10 @@ #include "HsFFI.h" +#if defined(__MINGW32__) +#include +#endif + #if defined(_MSC_VER) || defined(__MINGW32__) || defined(_WIN32) extern int __hscore_getFolderPath(HWND hwndOwner, int nFolder, @@ -47,33 +57,25 @@ extern int __hscore_getFolderPath(HWND hwndOwner, # endif #endif -#ifdef PATH_MAX /* A size that will contain many path names, but not necessarily all * (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 __hscore_long_path_size() { +#ifdef PATH_MAX + return PATH_MAX; #else -INLINE HsInt __hscore_long_path_size() { return 4096; } + return 4096; #endif +} -#ifdef R_OK +#ifdef __GLASGOW_HASKELL__ INLINE int __hscore_R_OK() { return R_OK; } -#endif -#ifdef W_OK INLINE int __hscore_W_OK() { return W_OK; } -#endif -#ifdef X_OK INLINE int __hscore_X_OK() { return X_OK; } -#endif -#ifdef S_IRUSR INLINE mode_t __hscore_S_IRUSR() { return S_IRUSR; } -#endif -#ifdef S_IWUSR INLINE mode_t __hscore_S_IWUSR() { return S_IWUSR; } -#endif -#ifdef S_IXUSR INLINE mode_t __hscore_S_IXUSR() { return S_IXUSR; } #endif