/* -----------------------------------------------------------------------------
- * $Id: HsBase.h,v 1.30 2003/09/25 15:14:44 panne Exp $
+ * $Id: HsBase.h,v 1.31 2003/10/13 03:19:48 sof Exp $
*
* (c) The University of Glasgow 2001-2002
*
-------------------------------------------------------------------------- */
#ifndef INLINE
-#define INLINE extern inline
+# if defined(_MSC_VER)
+# define INLINE extern __inline
+# else
+# define INLINE extern inline
+# endif
#endif
+#if !defined(_MSC_VER) && !defined(__MINGW__)
INLINE int __hscore_s_isreg(m) { return S_ISREG(m); }
INLINE int __hscore_s_isdir(m) { return S_ISDIR(m); }
INLINE int __hscore_s_isfifo(m) { return S_ISFIFO(m); }
#ifdef S_ISSOCK
INLINE int __hscore_s_issock(m) { return S_ISSOCK(m); }
#endif
+#endif
-#ifndef mingw32_TARGET_OS
+#if !defined(mingw32_TARGET_OS) && !defined(_MSC_VER) && !defined(__MINGW__)
INLINE int
__hscore_sigemptyset( sigset_t *set )
{ return sigemptyset(set); }
INLINE HsInt
__hscore_o_binary()
{
+#if defined(_MSC_VER)
+ return O_BINARY;
+#else
return CONST_O_BINARY;
+#endif
}
INLINE int
INLINE HsInt __hscore_long_path_size() { return 4096; }
#endif
+#ifdef R_OK
INLINE mode_t __hscore_R_OK() { return R_OK; }
+#endif
+#ifdef W_OK
INLINE mode_t __hscore_W_OK() { return W_OK; }
+#endif
+#ifdef X_OK
INLINE mode_t __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
+#if !defined(_MSC_VER) && !defined(__MINGW__)
INLINE HsAddr
__hscore_d_name( struct dirent* d )
{
return (HsAddr)(d->d_name);
#endif
}
+#endif
INLINE HsInt
__hscore_end_of_dir( void )
INLINE time_t __hscore_st_mtime ( struct stat* st ) { return st->st_mtime; }
INLINE off_t __hscore_st_size ( struct stat* st ) { return st->st_size; }
+#if !defined(_MSC_VER) && !defined(__MINGW__)
INLINE mode_t __hscore_st_mode ( struct stat* st ) { return st->st_mode; }
+#endif
#if HAVE_TERMIOS_H
INLINE tcflag_t __hscore_lflag( struct termios* ts ) { return ts->c_lflag; }
INLINE unsigned char*
__hscore_ptr_c_cc( struct termios* ts )
{ return (unsigned char*) &ts->c_cc; }
-#endif
INLINE HsInt
__hscore_sizeof_termios( void )
return 0;
#endif
}
+#endif
+#if !defined(_MSC_VER) && !defined(__MINGW__)
INLINE HsInt
__hscore_sizeof_sigset_t( void )
{
return 0;
#endif
}
+#endif
INLINE int
__hscore_echo( void )
INLINE int __hscore_hs_fileno (FILE *f) { return fileno (f); }
-#ifndef mingw32_TARGET_OS
+#if !defined(mingw32_TARGET_OS) && !defined(_MSC_VER) && !defined(__MINGW32__)
INLINE int __hsposix_SIGABRT() { return SIGABRT; }
INLINE int __hsposix_SIGALRM() { return SIGALRM; }
INLINE int __hsposix_SIGBUS() { return SIGBUS; }