X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=support%2Fmph.h;h=56f83e52b16e6c832bab0b8ec843fd640c2b3abb;hb=444f1ae2c091de3ce8646fcd5be4479a46deb1d4;hp=0c8b37fdd93075a090e5ccb9ab967da059d2a00a;hpb=5e6643734df34c002b914b3d44c91ed897a8a6d6;p=mono.git diff --git a/support/mph.h b/support/mph.h index 0c8b37fdd93..56f83e52b16 100644 --- a/support/mph.h +++ b/support/mph.h @@ -35,13 +35,11 @@ #include /* for SIZE_MAX */ #endif -#include "map-icalls.h" - #if __APPLE__ || __BSD__ || __FreeBSD__ #define MPH_ON_BSD #endif -#ifdef __GNUC__ +#ifdef HAVE_VISIBILITY_HIDDEN #define MPH_INTERNAL __attribute__((visibility("hidden"))) #else #define MPH_INTERNAL @@ -51,6 +49,38 @@ #define EOVERFLOW 75 #endif /* def PLATFORM_WIN32 && ndef EOVERFLOW */ +#if !defined (PLATFORM_WIN32) + +/* + * Solaris doesn't define these BSD values, and if they're not present then + * map.c:Mono_Posix_FromSeekFlags() breaks badly; see: + * http://bugzilla.gnome.org/show_bug.cgi?id=370081 + */ + +#ifndef L_SET +#define L_SET SEEK_SET +#endif /* ndef L_SET */ + +#ifndef L_INCR +#define L_INCR SEEK_CUR +#endif /* ndef L_INCR */ + +#ifndef L_XTND +#define L_XTND SEEK_END +#endif /* ndef L_XTND */ + +/* + * XATTR_AUTO is a synonym for 0 within XattrFlags, but most systems don't + * define it. map.c doesn't know that, though, so we ensure that it's defined + * so that the value 0 round-trips through MonoPosixHelper. + */ + +#ifndef XATTR_AUTO +#define XATTR_AUTO 0 +#endif /* ndef XATTR_AUTO */ + +#endif /* ndef PLATFORM_WIN32 */ + typedef gint64 mph_blkcnt_t; typedef gint64 mph_blksize_t; typedef guint64 mph_dev_t; @@ -67,6 +97,19 @@ typedef gint64 mph_clock_t; typedef guint64 mph_fsblkcnt_t; typedef guint64 mph_fsfilcnt_t; +/* Some versions of OS X don't define these typedefs, needed by map.c */ +#ifndef HAVE_BLKCNT_T +typedef mph_blkcnt_t blkcnt_t; +#endif + +#ifndef HAVE_BLKSIZE_T +typedef mph_blksize_t blksize_t; +#endif + +#ifndef HAVE_SUSECONDS_T +typedef gint64 suseconds_t; +#endif + #ifdef HAVE_LARGE_FILE_SUPPORT #define MPH_OFF_T_MAX G_MAXINT64 #define MPH_OFF_T_MIN G_MININT64