[MPlayer-dev-eng] [PATCH] osdep/mmap.h: define MAP_FAILED if necessary

Alexander Strasser eclipse7 at gmx.net
Mon Sep 30 22:41:36 EEST 2024


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


More information about the MPlayer-dev-eng mailing list