Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JIRA5-00035L-2i for qemu-devel@nongnu.org; Fri, 25 Jan 2008 11:12:13 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JIRA3-00031e-48 for qemu-devel@nongnu.org; Fri, 25 Jan 2008 11:12:12 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JIRA2-00031E-K2 for qemu-devel@nongnu.org; Fri, 25 Jan 2008 11:12:10 -0500 Received: from mail.gmx.net ([213.165.64.20]) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1JIRA2-0003tK-6P for qemu-devel@nongnu.org; Fri, 25 Jan 2008 11:12:10 -0500 Date: Fri, 25 Jan 2008 16:11:59 +0000 (GMT) From: Johannes Schindelin Subject: Re: [Qemu-devel] [PATCH] Allow AF_UNIX sockets to be disabled on non-Windows In-Reply-To: <18329.64767.131557.532119@mariner.uk.xensource.com> Message-ID: References: <18329.63445.210933.809690@mariner.uk.xensource.com> <4799FB94.5070406@codemonkey.ws> <18329.64767.131557.532119@mariner.uk.xensource.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Ian Jackson Cc: qemu-devel@nongnu.org Hi, On Fri, 25 Jan 2008, Ian Jackson wrote: > But when the existing code says > > } > #ifndef _WIN32 > if (strstart(display, "unix:", &p)) { > addr = (struct sockaddr *)&uaddr; > addrlen = sizeof(uaddr); > etc. > > then changing it to something like > > #if !(defined(_WIN32) || defined(MINIOS) > > seems very ugly. Yes, that is very ugly. But changing it to #ifndef NO_AF_UNIX_SOCKETS it actually gives you a bit of documentation what the code does, in addition to controlling what is compiled and what not. Like in the patch we saw today where there were a lot of "#ifdef __linux__", it is always good if you can see _why_ some code is enabled or disabled, instead of for what platform. Ciao, Dscho