Thread (10 messages) flat view 10 messages, 4 authors, 2016-06-15

Re: daemon.c broken on OpenBSD

From: Linus Torvalds <torvalds@osdl.org>
Date: 2016-06-15 22:42:09


On Mon, 24 Oct 2005, Randal L. Schwartz wrote:
That probably won't work, because on OpenBSD, it's not a #define, but
rather a real function call.  You can't just #undef that (unless my C
is even more rusty).
Sure you can. 

The #undef won't necessarily _do_ anything, but it protects against 
systems where it is a #define. Then, the #define makes sure that if it's 
anything else, the #define will take precedence.

So yes, it's ugly, but it definitely is safe in practice, as long as the 
local headers are included before the system ones.

I think Junio's patch (that renames things) is possibly the "cleaner" 
alternative, but on the other hand there's a lot of advantages to just 
using the standard names. No chance of somebody using the wrong version by 
mistake.

			Linus
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help