Date: Wed, 17 May 2000 10:19:47 +0300 (IDT) From: Eli Zaretskii X-Sender: eliz AT is To: Laurynas Biveinis cc: DJGPP Workers Subject: Re: Minor GCC & DJGPP header problem In-Reply-To: <39219CC4.EC6D90A@softhome.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp-workers AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk 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.