changeset 1685:babd4142523f

Some systems (BSD,MacOsX,HP-UX,...) define MAP_ANON and not MAP_ANONYMOUS. Make each an alias of other to be sure. issue reported by Martin Proetzsch.
author zas_
date Thu, 30 Jul 2009 17:59:20 +0000
parents 51820482c7e5
children c69e08a6c539
files src/compat.h src/main.c
diffstat 2 files changed, 22 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/src/compat.h	Tue Jul 28 22:27:24 2009 +0000
+++ b/src/compat.h	Thu Jul 30 17:59:20 2009 +0000
@@ -21,5 +21,13 @@
 #endif
 
 
+/* Some systems (BSD,MacOsX,HP-UX,...) define MAP_ANON and not MAP_ANONYMOUS */
+#if defined(MAP_ANON) && !defined(MAP_ANONYMOUS)
+#define	MAP_ANONYMOUS	MAP_ANON
+#elif defined(MAP_ANONYMOUS) && !defined(MAP_ANON)
+#define	MAP_ANON	MAP_ANONYMOUS
+#endif
+
+
 #endif /* COMPAT_H */
 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */
--- a/src/main.c	Tue Jul 28 22:27:24 2009 +0000
+++ b/src/main.c	Thu Jul 30 17:59:20 2009 +0000
@@ -10,6 +10,20 @@
  * This software comes with no warranty of any kind, use at your own risk!
  */
 
+#include <gdk/gdkkeysyms.h> /* for keyboard values */
+#ifdef HAVE_LIBCHAMPLAIN
+#ifdef HAVE_LIBCHAMPLAIN_GTK
+#include <clutter-gtk/gtk-clutter-embed.h>
+#endif
+#endif
+
+#include <signal.h>
+#include <sys/mman.h>
+
+#include <math.h>
+#ifdef G_OS_UNIX
+#include <pwd.h>
+#endif
 
 #include "main.h"
 
@@ -36,20 +50,6 @@
 #include "histogram.h"
 #include "pixbuf_util.h"
 
-#include <gdk/gdkkeysyms.h> /* for keyboard values */
-#ifdef HAVE_LIBCHAMPLAIN
-#ifdef HAVE_LIBCHAMPLAIN_GTK
-#include <clutter-gtk/gtk-clutter-embed.h>
-#endif
-#endif
-
-#include <signal.h>
-#include <sys/mman.h>
-
-#include <math.h>
-#ifdef G_OS_UNIX
-#include <pwd.h>
-#endif
 
 gboolean thumb_format_changed = FALSE;
 static RemoteConnection *remote_connection = NULL;