Mats Erik Andersson <[email protected]> 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
