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