delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/11/04/13:32:31

Date: Thu, 4 Nov 1999 17:18:33 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Joe Heafner <heafnerj AT interpath DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: can't find DJGPP header files in MingW32
In-Reply-To: <382185F2.534DD540@interpath.com>
Message-ID: <Pine.SUN.3.91.991104171048.14397D-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Thu, 4 Nov 1999, Joe Heafner wrote:

> Where would I find the replacements, or at least documentation on them?

The best documentation of the header is the header itself.  It is always 
available as a source, so you can look there.

As for replacements, you need first to find out what symbols from the 
header does the program use.  To that end, create an empty header with 
that name and compile with Mingw (or whatever).  If the compiler misses 
some constants or prototypes, it will complain about them.  You will thus 
know what is the header used for.  Once you know that, it shouldn't be 
hard to find a more portable constant or header that solves the problem; 
if you cannot figure that out, just tell what the compiler printed and 
ask for advice.

As an example, sys/param.h defines a constant MAXPATHLEN.  The portable 
replacement for it is FILENAME_MAX, and it lives in stdio.h which is 
available with every compiler.

> This particular software can currently and MUST be able to compile under
> DOS, Solaris, Linux, and OS/2 (Windows is included here as it's just
> another DOS program) using EMX, DJGPP 2.8, and Visual C++.

If you want portability to such a wide variety of platforms, you should 
*never* use any non-standard headers such as sys/param.h.  Stick to 
ANSI-standard headers, and if that is not enough, add Posix ones.  If you 
cannot find any portable header that does the job, use #ifdef to include 
platform-specific headers.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019