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