X-Authentication-Warning: acp3bf.physik.rwth-aachen.de: broeker owned process doing -bs Date: Wed, 8 Mar 2000 11:29:22 +0100 (MET) From: Hans-Bernhard Broeker X-Sender: broeker AT acp3bf To: djgpp-workers AT delorie DOT com Subject: Re: iso646.h and some questions In-Reply-To: <200003080806.JAA17092@mars.lu.erisoft.se> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp-workers AT delorie DOT com Errors-To: dj-admin AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Wed, 8 Mar 2000, Martin Stromberg wrote: > > On Mon, 6 Mar 2000, Martin Stromberg wrote: > > In the actual standard, it's even quite a bit stronger than that: none of > > the standard headers is *allowed* to just #include any of the others. > > They're supposed to be choosable 100% independantly. [... standard quoted ...] > This passage is in the standard exactly as quoted here. I thought so. Thanks for double-checking. [...] > So what do we do about NULL, that should be in both wchar.h and > stddef.h? Just add the same two lines to wchar.h that are already in all the other ANSI headers that also define NULL (it's defined by half a dozen of them...): #undef NULL #define NULL 0 This not a particularly nice technique, but it works. For a more 'organized' solution, a common or similar might be used. For a case as simple as NULL, it's not strictly necessary, of course, but it's still a good idea to keep everything defined in exactly one place, instead of having several definitions of it floating around. A different technique (used by P.J.Plauger in his excellent book The Standard C Library) is to collect all the vital #defines that are system-dependent into a single header file (he calls it ): would have the 'central' definition: #define _NULL 0 and all other headers that want to define NULL would then #include