Subject: Re: Compiling NetBSD with another compiler.
To: None <email@example.com>
From: Joerg Sonnenberger <firstname.lastname@example.org>
Date: 10/13/2007 15:46:40
On Sat, Oct 13, 2007 at 04:37:27PM +0300, Aleksey Cheusov wrote:
> > On Sat, Oct 13, 2007 at 01:01:09PM +0300, Aleksey Cheusov wrote:
> >> Why non-portable way of doing this renaming is used instead of
> >> just using macro like
> >> #define func func_new
> > What do you do about user code that #undef's func?
> You can not do anything with USER's code.
> What do you do if user make this?
> #undef AF_INET
> #define AF_INET <any_random_value>
Please read again what I said. AF_INET is a symbolic definition, a
program can override that and gets the expected result. For things like
fgetc, the semantic behaviour is "function and macro behave the same".
So if you undef the macro, it would now be different.
> > In short, there is *no* standard way to achieve this behaviour.
> Ok. There is no 100% way...but there is more
> pragmatical solution I think.
There isn't even a more pragmantic solution if you don't want to break
the application namespace.