qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] Allow AF_UNIX sockets to be disabled on non-Win


From: Johannes Schindelin
Subject: Re: [Qemu-devel] [PATCH] Allow AF_UNIX sockets to be disabled on non-Windows
Date: Fri, 25 Jan 2008 16:11:59 +0000 (GMT)
User-agent: Alpine 1.00 (LSU 882 2007-12-20)

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]