Mercurial > hg > octave-lyh > gnulib-hg
changeset 5688:5421c00f20ab
Don't define MAP_FILE and MAP_FAILED before <sys/mman.h> has been included.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Mon, 07 Mar 2005 17:29:29 +0000 |
parents | 78dca9b2cfa4 |
children | b3337869f59c |
files | lib/ChangeLog lib/pagealign_alloc.c m4/ChangeLog m4/mmap-anon.m4 |
diffstat | 4 files changed, 20 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -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>
--- a/lib/pagealign_alloc.c +++ b/lib/pagealign_alloc.c @@ -48,6 +48,17 @@ #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
--- a/m4/ChangeLog +++ b/m4/ChangeLog @@ -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:
--- a/m4/mmap-anon.m4 +++ b/m4/mmap-anon.m4 @@ -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 @@ [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 ])