From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39391) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSl67-0003Jd-TL for qemu-devel@nongnu.org; Tue, 12 Jun 2018 11:20:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSl63-0006nl-0y for qemu-devel@nongnu.org; Tue, 12 Jun 2018 11:20:39 -0400 Received: from mail-it0-x241.google.com ([2607:f8b0:4001:c0b::241]:35749) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fSl62-0006nM-Pl for qemu-devel@nongnu.org; Tue, 12 Jun 2018 11:20:34 -0400 Received: by mail-it0-x241.google.com with SMTP id a3-v6so15922911itd.0 for ; Tue, 12 Jun 2018 08:20:34 -0700 (PDT) References: <20180606181352.61144-1-lfy@google.com> From: Richard Henderson Message-ID: <6155757f-6dad-9299-80c3-d6ae4cc86e75@linaro.org> Date: Tue, 12 Jun 2018 05:20:28 -1000 MIME-Version: 1.0 In-Reply-To: <20180606181352.61144-1-lfy@google.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] Improve file-backed RAM List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Lingfeng Yang , qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , Peter Crosthwaite , Eduardo Habkost On 06/06/2018 08:13 AM, Lingfeng Yang via Qemu-devel wrote: > size_t qemu_mempath_getpagesize(const char *mem_path) > { > +#ifndef _WIN32 > #ifdef CONFIG_LINUX > struct statfs fs; > int ret; > @@ -73,10 +82,14 @@ size_t qemu_mempath_getpagesize(const char *mem_path) > #endif > > return getpagesize(); > +#else > + return WIN_FILE_PAGE_SIZE; > +#endif > } As a rule, positive tests are easier to read than negative ones. And when it comes to nesting ifdefs, doubly so. r~