[MPlayer-dev-eng] [PATCH] osdep/mmap.h: define MAP_FAILED if necessary
KO Myung-Hun
komh78 at gmail.com
Fri Sep 27 18:36:38 EEST 2024
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
More information about the MPlayer-dev-eng
mailing list