Add a --with-llvm=<llvm prefix> argument to configure to make the location of llvm...
[mono.git] / support / mph.h
index 224f01093333f715a3408958c87047673c7b07cf..aedff01b7f32d6f8ce7f2a570c0472afa6e48c6e 100644 (file)
@@ -36,7 +36,7 @@
 #include <stdint.h>             /* for SIZE_MAX */
 #endif
 
-#if __APPLE__ || __BSD__ || __FreeBSD__
+#if __APPLE__ || __BSD__ || __FreeBSD__ || __OpenBSD__
 #define MPH_ON_BSD
 #endif
 
 #define MPH_INTERNAL
 #endif
 
-#if defined (PLATFORM_WIN32) && !defined (EOVERFLOW)
-#define EOVERFLOW 75
-#endif /* def PLATFORM_WIN32 && ndef EOVERFLOW */
+#if !defined(EOVERFLOW)
+#  if defined(HOST_WIN32)
+#    define EOVERFLOW 75
+#  elif defined(__OpenBSD__)
+#    define EOVERFLOW 87
+#  endif
+#endif /* !defined(EOVERFLOW) */
 
-#if !defined (PLATFORM_WIN32)
+#if !defined (HOST_WIN32)
 
 /* 
  * Solaris doesn't define these BSD values, and if they're not present then
 #define L_XTND SEEK_END
 #endif /* ndef L_XTND */
 
+/*
+ * 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
+#ifndef MAP_ANONYMOUS
+#define MAP_ANONYMOUS MAP_ANON
+#endif  /* ndef MAP_ANONYMOUS */
+#endif  /* ndef PLATFORM_MACOSX */
+
 /*
  * 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
@@ -80,7 +94,7 @@
 #define XATTR_AUTO 0
 #endif /* ndef XATTR_AUTO */
 
-#endif /* ndef PLATFORM_WIN32 */
+#endif /* ndef HOST_WIN32 */
 
 typedef    gint64 mph_blkcnt_t;
 typedef    gint64 mph_blksize_t;