[project @ 2005-01-28 12:55:17 by simonmar]
[ghc-hetmet.git] / ghc / lib / compat / cbits / directory.c
1 #include "../../../includes/ghcconfig.h"\r
2 \r
3 #include "HsFFI.h"\r
4 \r
5 #if HAVE_LIMITS_H\r
6 #include <limits.h>\r
7 #endif\r
8 #if HAVE_WINDOWS_H\r
9 #include <windows.h>\r
10 #endif\r
11 \r
12 #define INLINE /* nothing */\r
13 \r
14 /*\r
15  * Following code copied from libraries/base/includes/HsBase.h\r
16  */\r
17 \r
18 #ifdef PATH_MAX\r
19 /* A size that will contain many path names, but not necessarily all\r
20  * (PATH_MAX is not defined on systems with unlimited path length,\r
21  * e.g. the Hurd).\r
22  */\r
23 INLINE HsInt __compat_long_path_size() { return PATH_MAX; } \r
24 #else\r
25 INLINE HsInt __compat_long_path_size() { return 4096; }\r
26 #endif\r
27 \r
28 #if defined(mingw32_HOST_OS)\r
29 \r
30 /* Make sure we've got the reqd CSIDL_ constants in scope;\r
31  * w32api header files are lagging a bit in defining the full set.\r
32  */\r
33 #if !defined(CSIDL_APPDATA)\r
34 #define CSIDL_APPDATA 0x001a\r
35 #endif\r
36 #if !defined(CSIDL_PERSONAL)\r
37 #define CSIDL_PERSONAL 0x0005\r
38 #endif\r
39 #if !defined(CSIDL_PROFILE)\r
40 #define CSIDL_PROFILE 0x0028\r
41 #endif\r
42 #if !defined(CSIDL_WINDOWS)\r
43 #define CSIDL_WINDOWS 0x0024\r
44 #endif\r
45 \r
46 INLINE int __hscore_CSIDL_PROFILE()  { return CSIDL_PROFILE;  }\r
47 INLINE int __hscore_CSIDL_APPDATA()  { return CSIDL_APPDATA;  }\r
48 INLINE int __hscore_CSIDL_WINDOWS()  { return CSIDL_WINDOWS;  }\r
49 INLINE int __hscore_CSIDL_PERSONAL() { return CSIDL_PERSONAL; }\r
50 #endif\r