From owner-cvs-all Tue Oct 30 8: 9:12 2001 Delivered-To: cvs-all@freebsd.org Received: from straylight.ringlet.net (sentinel.office1.bg [217.75.129.210]) by hub.freebsd.org (Postfix) with SMTP id F142D37B408 for ; Tue, 30 Oct 2001 08:08:55 -0800 (PST) Received: (qmail 2065 invoked by uid 1000); 30 Oct 2001 14:51:56 -0000 Date: Tue, 30 Oct 2001 16:51:56 +0200 From: Peter Pentchev To: John Baldwin Cc: cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org, Garrett Wollman Subject: Re: cvs commit: src/include malloc.h Message-ID: <20011030165156.D31154@straylight.oblivion.bg> Mail-Followup-To: John Baldwin , cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org, Garrett Wollman References: <20011030164640.C31154@straylight.oblivion.bg> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from jhb@FreeBSD.org on Tue, Oct 30, 2001 at 08:06:27AM -0800 Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Tue, Oct 30, 2001 at 08:06:27AM -0800, John Baldwin wrote: > > On 30-Oct-01 Peter Pentchev wrote: > > On Tue, Oct 30, 2001 at 10:57:17AM -0500, Garrett Wollman wrote: > >> < > >> said: > >> > >> > Just BTW, what is the correct test to use for malloc.h vs stdlib.h? > >> > Will __STDC__ be enough? > >> > >> #if HAVE_STDLIB_H > > > > Eep.. :) > > > >> __STDC__ tells you about the compiler; it doesn't tell you whether the > >> compilation environment is actually valid. In FreeBSD, we have always > >> had , even when compiling with `gcc -traditional'. > > > > Well, I figured that much.. but this does not help me much :) > > > > I'm asking more from the standpoint of submitting fixes back to authors > > of various ported software; e.g. right now, I'm struggling with a big > > piece of software which has a *lot* of: > > > >#if defined(BSDI) > >#include > >#else > >#include > >#endif > > > > I could easily change that to defined(BSDI) || defined(__FreeBSD__), > > but.. you mean there really is no way to do this better? :\ > > Err, that code is right. malloc.h is deprecated and stdlib.h should be what is > included. Erm, ok, cut-and-paste-o. Rather, not-cut-and-paste-o. I quoted from memory, and of course I got it wrong :( The idea behind the piece of code is 'use stdlib.h on BSDI, malloc.h everywhere else'. Apparently, 'everywhere else' was supposed to mean 'on Linux' :( I know it is so, because this broke for me when I put the #error in my -stable's malloc.h :) G'luck, Peter -- This sentence every third, but it still comprehensible. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message