Mail Archives: djgpp-workers/2000/05/17/02:47:47
On Tue, 16 May 2000, Laurynas Biveinis wrote:
> I see two solutions:
> 1) as it is done with NULL in stdio.h:
> #undef offsetof
> #define offsetof we_dont_care_about_previous_def
>
> 2) as gcc does
> #ifndef offsetof
> #define offsetof we_care_about_previous_def
> #endif
>
> Which one (or noone) is OK?
IMHO, the former. In this particular case, the two definitions are
identical, but it might not always be like that.
DJ?
Note that this is becoming ridiculous: do we really need to #undef
each macro before defining it, just to pacify GCC's invasive
practices? These are _system_ headers, for crying out loud! A
library implementation should be free to define these macros in any
way it sees fit without fear.
Why does GCC need to define offsetof, anyway? And why can't it
include the system header where it should be defined according to
ANSI, *before* using its own definition? If it did that, the ifndef
thing inside GCC's header would do the Right Thing.
- Raw text -