Received: from eggs.gnu.org ([2001:4830:134:3::10]:37373) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VMBUC-0006kE-OC for qemu-devel@nongnu.org; Wed, 18 Sep 2013 02:43:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VMBU7-0001Xm-T9 for qemu-devel@nongnu.org; Wed, 18 Sep 2013 02:43:40 -0400 From: Markus Armbruster References: <1379483296-20374-1-git-send-email-sw@weilnetz.de> Date: Wed, 18 Sep 2013 08:43:30 +0200 In-Reply-To: <1379483296-20374-1-git-send-email-sw@weilnetz.de> (Stefan Weil's message of "Wed, 18 Sep 2013 07:48:15 +0200") Message-ID: <87mwnaeijx.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] exec: Fix broken build for MinGW (regression) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Weil Cc: qemu-trivial , qemu-devel Stefan Weil writes: > Commit 3435f39513a104294b5e3bbf3612047028d25cfc reduced the ifdeffery with > this result for MinGW: > > exec.c: In function =E2=80=98qemu_ram_free=E2=80=99: > exec.c:1239:17: warning: > implicit declaration of function =E2=80=98munmap=E2=80=99 [-Wimplicit-fu= nction-declaration] > exec.c:1239:17: warning: > nested extern declaration of =E2=80=98munmap=E2=80=99 [-Wnested-externs] > exec.c:1239: undefined reference to `munmap' > > Add some ifdeffery again to fix this. > > Signed-off-by: Stefan Weil > --- > exec.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/exec.c b/exec.c > index 2646912..efeca14 100644 > --- a/exec.c > +++ b/exec.c > @@ -1229,9 +1229,11 @@ void qemu_ram_free(ram_addr_t addr) > ; > } else if (xen_enabled()) { > xen_invalidate_map_cache_entry(block->host); > +#ifndef _WIN32 > } else if (block->fd >=3D 0) { > munmap(block->host, block->length); > close(block->fd); > +#endif > } else { > qemu_anon_ram_free(block->host, block->length); > } The initial mmap() is under #ifdef __linux__, in file_ram_alloc(). However, the code manipulating it in qemu_ram_remap() is under #ifndef _WIN32, and your patch matches that. Makes sense. Thanks for cleaning up after me ;) Reviewed-by: Markus Armbruster