Mail Archives: djgpp/1999/11/04/13:32:31
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 -