Rejig the #ifdeffery directory_2007-05-24
authorIan Lynagh <igloo@earth.li>
Sun, 20 May 2007 15:57:43 +0000 (15:57 +0000)
committerIan Lynagh <igloo@earth.li>
Sun, 20 May 2007 15:57:43 +0000 (15:57 +0000)
Put __hscore_?_OK and __hscore_S_I?USR in the C inside
#ifdef __GLASGOW_HASKELL__ to match the foreign imports in the Haskell
code.

Don't check the constants are defined before defining the C functions,
as we assume that the functions exist in the Haskell code anyway.

include/HsDirectory.h

index 3680378..75c71c9 100644 (file)
@@ -59,23 +59,13 @@ INLINE HsInt __hscore_long_path_size() {
 #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