[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-inetutils] Macros __unix__ and unix.
From: |
Simon Josefsson |
Subject: |
Re: [bug-inetutils] Macros __unix__ and unix. |
Date: |
Sun, 08 Jan 2012 10:41:32 +0100 |
User-agent: |
Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.92 (gnu/linux) |
Mats Erik Andersson <address@hidden> writes:
> Dear all,
>
> a quick search
>
> $ git grep -l '#.*def.*\<unix\>'
> ftp/cmds.c
> ftpd/ftpcmd.y
> telnet/commands.c
> telnet/main.c
> telnet/telnet.c
> telnet/tn3270.c
> telnet/utilities.c
>
> hides a portability problem we have at present:
>
> GNU/Linux, OpenSolaris define "unix" and "__unix__",
>
> OpenBSD defines only "__unix__".
>
> In the above seven files, only "ftpd/ftpcmd.y" is accepting
> "unix" as well as "__unix__", the other only checks on "unix".
> Going to the contemporary OpenBSD source for "telnet", their
> make file circumvents the problem by passing "-Dunix" to Gcc,
> which we do not.
>
> Question: Is a manual rewrite using
>
> #if defined unix || defined __unix__
>
> a good solution, or should we let "configure.ac" trigger
> the insertion of a macro "unix" based on "__unix__", should
> the former be missing?
I don't care strongly, but support doing either.
However, your question begs the bigger question: do we really need these
#ifdef's at all? I looked at a few files, and most of the usage looked
like hacky workarounds. It is some work to rewrite the code though...
/Simon