[PATCH] osdep/mmap.h: define MAP_FAILED if necessary
KO Myung-Hun <[email protected]> Sat, 28 Sep 2024 00:36:38 +0900
| Newsgroups | gmane.comp.video.mplayer.devel |
|---|---|
| Message-ID | <[email protected]> |
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 -- 2.42.0