[project @ 2004-11-12 13:27:54 by simonpj]
[ghc-hetmet.git] / ghc / lib / compat / cbits / directory.c
diff --git a/ghc/lib/compat/cbits/directory.c b/ghc/lib/compat/cbits/directory.c
new file mode 100644 (file)
index 0000000..713911b
--- /dev/null
@@ -0,0 +1,54 @@
+#if __GLASGOW_HASKELL__ < 603\r
+#include "config.h"\r
+#else\r
+#include "ghcconfig.h"\r
+#endif\r
+\r
+#include "HsFFI.h"\r
+\r
+#if HAVE_LIMITS_H\r
+#include <limits.h>\r
+#endif\r
+#if HAVE_WINDOWS_H\r
+#include <windows.h>\r
+#endif\r
+\r
+#define INLINE /* nothing */\r
+\r
+/*\r
+ * Following code copied from libraries/base/includes/HsBase.h\r
+ */\r
+\r
+#ifdef PATH_MAX\r
+/* A size that will contain many path names, but not necessarily all\r
+ * (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
+#else\r
+INLINE HsInt __hscore_long_path_size() { return 4096; }\r
+#endif\r
+\r
+#if defined(mingw32_TARGET_OS)\r
+\r
+/* Make sure we've got the reqd CSIDL_ constants in scope;\r
+ * w32api header files are lagging a bit in defining the full set.\r
+ */\r
+#if !defined(CSIDL_APPDATA)\r
+#define CSIDL_APPDATA 0x001a\r
+#endif\r
+#if !defined(CSIDL_PERSONAL)\r
+#define CSIDL_PERSONAL 0x0005\r
+#endif\r
+#if !defined(CSIDL_PROFILE)\r
+#define CSIDL_PROFILE 0x0028\r
+#endif\r
+#if !defined(CSIDL_WINDOWS)\r
+#define CSIDL_WINDOWS 0x0024\r
+#endif\r
+\r
+INLINE int __hscore_CSIDL_PROFILE()  { return CSIDL_PROFILE;  }\r
+INLINE int __hscore_CSIDL_APPDATA()  { return CSIDL_APPDATA;  }\r
+INLINE int __hscore_CSIDL_WINDOWS()  { return CSIDL_WINDOWS;  }\r
+INLINE int __hscore_CSIDL_PERSONAL() { return CSIDL_PERSONAL; }\r
+#endif\r