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 a454f6f4d72b34062350ba1010b266119488e498..0a9a5e2b5b2fe6dc77b41f8d89a82784420d7095 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 848367064ddd8e95cf51eb34d970f5b51d975970..bc9a301588db4405486d2c1494af727e7974cfe4 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 559d8ea3e72e19550851842dab6e52b271ae9095..1adc353d0051d43563130e9936af714b80241d09 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 2abbe5589887252dc53fc038e753ee681a4305b2..d0fefeb68e38026712b38ffa5a4d8c3d3197fd99 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
 ])