remove some layout/rendering specific asserts, and fix the RowCount property in TabCo...
[mono.git] / support / mph.h
index 49a5e9781fcfd121a5998b6adf55b6bc79ad45ef..7c7705e958b991b0b6e4914531aa09e443f7a9d6 100644 (file)
@@ -17,6 +17,9 @@
  *
  * See the typedefs for type size assumptions.  These typedefs *must* be kept
  * in sync with the types used in Mono.Posix.dll.
+ *
+ * See also:
+ *   http://developer.apple.com/documentation/Darwin/Reference/ManPages/
  */
 
 #ifndef INC_mph_H
 
 #include <limits.h>             /* LONG_MAX, ULONG_MAX */
 #include <errno.h>              /* for ERANGE */
-#include <glib/gtypes.h>        /* for g* types, etc. */
+#include <glib.h>               /* for g* types, etc. */
 
 #ifdef HAVE_STDINT_H
 #include <stdint.h>             /* for SIZE_MAX */
 #endif
 
-#if __APPLE__ || __BSD__
+#if __APPLE__ || __BSD__ || __FreeBSD__
 #define MPH_ON_BSD
 #endif
 
+#ifdef HAVE_VISIBILITY_HIDDEN
+#define MPH_INTERNAL __attribute__((visibility("hidden")))
+#else
+#define MPH_INTERNAL
+#endif
+
+#if defined (PLATFORM_WIN32) && !defined (EOVERFLOW)
+#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 */
+
+#endif /* ndef PLATFORM_WIN32 */
+
 typedef    gint64 mph_blkcnt_t;
 typedef    gint64 mph_blksize_t;
 typedef   guint64 mph_dev_t;
@@ -49,6 +84,21 @@ typedef   guint32 mph_gid_t;
 typedef   guint32 mph_uid_t;
 typedef    gint64 mph_time_t;
 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
@@ -93,8 +143,13 @@ typedef    gint64 mph_clock_t;
 #define mph_return_val_if_size_t_overflow(var, ret) \
        _mph_return_val_if_cb_(var, ret, mph_have_size_t_overflow)
 
+#define mph_return_val_if_ssize_t_overflow(var, ret) \
+       _mph_return_val_if_cb_(var, ret, mph_have_long_overflow)
+
 #define mph_return_if_size_t_overflow(var) mph_return_val_if_size_t_overflow(var, -1)
 
+#define mph_return_if_ssize_t_overflow(var) mph_return_val_if_ssize_t_overflow(var, -1)
+
 #define mph_have_off_t_overflow(var) \
        (((var) < MPH_OFF_T_MIN) || ((var) > MPH_OFF_T_MAX))
 
@@ -126,6 +181,12 @@ recheck_range (int ret)
        return 0;
 }
 
+MPH_INTERNAL char* 
+_mph_copy_structure_strings (
+       void *to,         const size_t *to_offsets, 
+       const void *from, const size_t *from_offsets, 
+       size_t num_strings);
+
 #endif /* ndef INC_mph_H */
 
 /*