Re: [PATCH] osdep/mmap.h: define MAP_FAILED if necessary
Alexander Strasser <[email protected]> Mon, 30 Sep 2024 21:41:36 +0200
| Newsgroups | gmane.comp.video.mplayer.devel |
|---|---|
| Message-ID | <[email protected]> |
On 2024-09-28 00:36 +0900, KO Myung-Hun wrote: > If sys/mman.h defines MAP_FAILED, config.h will not define MAP_FAILED. > In this case, MAP_FAILED is not defined at all and compilation errors > occur. > --- > osdep/mmap.h | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/osdep/mmap.h b/osdep/mmap.h > index db7c136a9..9bd1b9e4b 100644 > --- a/osdep/mmap.h > +++ b/osdep/mmap.h > @@ -46,7 +46,9 @@ > */ > #define MAP_ANON 0x1000 /* allocated from memory, swap space */ > > -/* MAP_FAILED is defined in config.h */ > +#ifndef MAP_FAILED > +#define MAP_FAILED ((void *) -1) > +#endif > > #ifndef _MMAP_DECLARED > #define _MMAP_DECLARED > -- LGTM Alexander