[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] util: fix to check if target OS is linux in util/mmap-alloc.
From: |
Peter Maydell |
Subject: |
Re: [PATCH] util: fix to check if target OS is linux in util/mmap-alloc.c |
Date: |
Fri, 6 Mar 2020 12:14:39 +0000 |
On Fri, 6 Mar 2020 at 12:12, Jingqi Liu <address@hidden> wrote:
>
> The CONFIG_LINUX symbol is always undefined before including "qemu/osdep.h".
> Use __linux__ to check if target OS is linux instead of CONFIG_LINUX.
>
> Signed-off-by: Jingqi Liu <address@hidden>
> ---
> util/mmap-alloc.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/util/mmap-alloc.c b/util/mmap-alloc.c
> index 27dcccd8ec..8340540292 100644
> --- a/util/mmap-alloc.c
> +++ b/util/mmap-alloc.c
> @@ -10,12 +10,12 @@
> * later. See the COPYING file in the top-level directory.
> */
>
> -#ifdef CONFIG_LINUX
> +#ifdef __linux__
> #include <linux/mman.h>
> -#else /* !CONFIG_LINUX */
> +#else
> #define MAP_SYNC 0x0
> #define MAP_SHARED_VALIDATE 0x0
> -#endif /* CONFIG_LINUX */
> +#endif
This is not the right way to fix this. osdep.h must go
first, no exceptions.
thanks
-- PMM