X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=support%2Fmph.h;h=2fbae6a27cddd04bcbc592ac70a1a501256ce27e;hb=ef7a4c06206976de7ef2e974267407347ddb75a4;hp=cb5d94131da010bec4af329b7495109199948641;hpb=f9596050629ebf0d8d24fb256cc08f98d6d2c7e7;p=mono.git diff --git a/support/mph.h b/support/mph.h index cb5d94131da..2fbae6a27cd 100644 --- a/support/mph.h +++ b/support/mph.h @@ -32,10 +32,53 @@ #include /* for ERANGE */ #include /* for g* types, etc. */ +#ifdef HAVE_SYS_STAT_H +#include +#endif + #ifdef HAVE_STDINT_H #include /* for SIZE_MAX */ #endif +#ifdef ANDROID_UNIFIED_HEADERS +#ifdef HAVE_STDIO_H +#include +#endif + +#undef st_atime_nsec +#undef st_mtime_nsec +#undef st_ctime_nsec + +#ifndef L_cuserid +#define L_cuserid 9 /* size for cuserid(); UT_NAMESIZE + 1 */ +#endif + +/* NDK unified headers will define fpos_t to be 64-bit if large files support is + * enabled (which is the case with Mono) so we need to make sure the offsets here + * are actually 32-bit for Android APIs before API24 which did NOT have the 64-bit + * versions. + */ +#if !defined(fgetpos) && __ANDROID_API__ < 24 +int fgetpos(FILE*, fpos_t*); +#endif + +#if !defined(fsetpos) && __ANDROID_API__ < 24 +int fsetpos(FILE*, const fpos_t*); +#endif + +#ifdef HAVE_PWD_H +#include +#endif +/* Unified headers define 'pw_gecos' to be an alias for 'pw_passwd` on 32-bit Android which + * results in two fields named 'pw_passwd' in map.h's 'struct passwd' + */ +#if !defined(__LP64__) && defined(pw_gecos) +#undef pw_gecos +#undef HAVE_STRUCT_PASSWD_PW_GECOS +#endif + +#endif + #if __APPLE__ || __BSD__ || __FreeBSD__ || __OpenBSD__ #define MPH_ON_BSD #endif @@ -54,11 +97,9 @@ # endif #endif /* !defined(EOVERFLOW) */ -#if !defined (HOST_WIN32) - /* - * Solaris doesn't define these BSD values, and if they're not present then - * map.c:Mono_Posix_FromSeekFlags() breaks badly; see: + * Solaris/Windows don'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 */ @@ -74,15 +115,17 @@ #define L_XTND SEEK_END #endif /* ndef L_XTND */ +#if !defined (HOST_WIN32) + /* * OS X doesn't define MAP_ANONYMOUS, but it does define MAP_ANON. * Alias them to fix: https://bugzilla.xamarin.com/show_bug.cgi?id=3419 */ -#ifdef PLATFORM_MACOSX +#ifdef HOST_DARWIN #ifndef MAP_ANONYMOUS #define MAP_ANONYMOUS MAP_ANON #endif /* ndef MAP_ANONYMOUS */ -#endif /* ndef PLATFORM_MACOSX */ +#endif /* ndef HOST_DARWIN */ /* * XATTR_AUTO is a synonym for 0 within XattrFlags, but most systems don't