Subject: Re: Compiling NetBSD with another compiler.
To: None <email@example.com>
From: Aleksey Cheusov <firstname.lastname@example.org>
Date: 10/13/2007 16:37:27
> 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?
#define AF_INET <any_random_value>
I'm talking about system headers only.
> That is valid for a
> number of macro/function pairs (e.g. fgetc). What do you do about user
> defined structs with a field "func"? That's perfectly valid C and would
> break horrible depending on the include order of header files.
Ok. Good point.
> 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.
use gcc/pcc function renaming
use things like #define stat stat_new
#error "no way to make function renaming"
Best regards, Aleksey Cheusov.