Don't define MAP_FILE and MAP_FAILED before <sys/mman.h> has been included.
authorBruno Haible <bruno@clisp.org>
Mon, 7 Mar 2005 17:29:29 +0000 (17:29 +0000)
committerBruno Haible <bruno@clisp.org>
Mon, 7 Mar 2005 17:29:29 +0000 (17:29 +0000)
lib/ChangeLog
lib/pagealign_alloc.c
m4/ChangeLog
m4/mmap-anon.m4

index a454f6f..0a9a5e2 100644 (file)
@@ -1,3 +1,7 @@
+2005-03-07  Bruno Haible  <bruno@clisp.org>
+
+       * pagealign_alloc.c (MAP_FILE, MAP_FAILED): Define fallbacks.
+
 2005-03-03  Derek R. Price  <derek@ximbiot.com>
             Bruno Haible  <bruno@clisp.org>
 
index 8483670..bc9a301 100644 (file)
 
 #define _(str) gettext (str)
 
+#if HAVE_MMAP
+/* Define MAP_FILE when it isn't otherwise.  */
+# ifndef MAP_FILE
+#  define MAP_FILE 0
+# endif
+/* Define MAP_FAILED for old systems which neglect to.  */
+# ifndef MAP_FAILED
+#  define MAP_FAILED ((void *)-1)
+# endif
+#endif
+
 
 #if HAVE_MMAP || ! HAVE_POSIX_MEMALIGN
 
index 559d8ea..1adc353 100644 (file)
@@ -1,3 +1,7 @@
+2005-03-07  Bruno Haible  <bruno@clisp.org>
+
+       * mmap-anon.m4 (MAP_FILE, MAP_FAILED): Remove definitions.
+
 2005-03-03  Bruno Haible  <bruno@clisp.org>
 
        * inttypes.m4, isc-posix.m4, once-only.m4:
index 2abbe55..d0fefeb 100644 (file)
@@ -1,4 +1,4 @@
-# mmap-anon.m4 serial 1
+# mmap-anon.m4 serial 2
 dnl Copyright (C) 2005 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -44,16 +44,5 @@ AC_DEFUN([gl_FUNC_MMAP_ANON],
         [Define to 1 if mmap()'s MAP_ANONYMOUS flag is available after including
          config.h and <sys/mman.h>.])
     fi
-
-    AH_VERBATIM([MAP_FILE],
-[/* Define MAP_FILE when it isn't otherwise.  */
-#ifndef MAP_FILE
-# define MAP_FILE 0
-#endif
-
-/* Define MAP_FAILED for old systems which neglect to.  */
-#ifndef MAP_FAILED
-# define MAP_FAILED ((void *)-1)
-#endif])
   fi
 ])