🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c.moderated
Article #2357

Re: Search for the Universal Header File

#2357
From: Michael Smith
Date: Sat, 23 Mar 1996 06:44
37 lines
2091 bytes
Chris Torek wrote:
> 
>         - Simply #include <stdlib.h>, and require that it be
>           correct (by fixing or replacing the implementation if
>           necessary).

Can't agree with that.  Changing system headers is a recipe for 
maintenance disasters.

> 
>         - Write my own module that implements memory allocation;
>           put any gross #ifdef'ing into it, and use `myalloc()'
>           everywhere.  This is particularly sensible if you want to
>           use a `void *' allocator (some of the systems return
>           `char *') and/or have a standard out-of-memory error.
> 
>         - Use a macro to define the name of the correct header, and
>           `#include MALLOC_H'.

No real objection to either of these.


Let me clear up one thing.  I was not saying that I agreed with the 
universal header concept, simply explaining what it was.  An earlier 
poster appeared to have misunderstood.

My preferred method is to encapsulate particular subsystems where 
portability is an issue.  I have been known to use a "sysdefs.h" or 
similar where system specific macros were defined, such as the
#define MALLOC_H <stdlib.h> from your example.


-- 
#####################################################################
Michael Smith                                       msmith@mpx.com.au
Emmenjay Consulting                 http://www.hutch.com.au/~emmenjay
#####################################################################
Technical Details
Message-ID: <4j06k0$7s9@solutions.solon.com>
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail
References: <4gqe8u$pn7@solutions.solon.com> <4h81eq$ai9@solutions.solon.com> <4i2jsl$8ff@solutions.solon.com> <4iermd$apc@solutions.solon.com> <4io1k5$npv@solutions.solon.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail
From: Michael Smith <msmith@mpx.com.au>
Newsgroups: comp.lang.c.moderated
Subject: Re: Search for the Universal Header File
Date: 23 Mar 1996 00:44:16 -0600
Organization: Emmenjay Consulting
Sender: clc@solutions.solon.com
Approved: clc@solutions.solon.com
Message-ID: <4j06k0$7s9@solutions.solon.com>
References: <4gqe8u$pn7@solutions.solon.com> <4h81eq$ai9@solutions.solon.com> <4i2jsl$8ff@solutions.solon.com> <4iermd$apc@solutions.solon.com> <4io1k5$npv@solutions.solon.com>
NNTP-Posting-Host: solutions.solon.com
X-Mailer: Mozilla 2.0 (Win16; I)