Frustrated trying to be portable
Steve Emmerson
steve at groucho.ucar.edu
Mon Feb 18 13:34:29 AEST 1991
[I'm posting this article rather than replying via email due to the
general nature of the problem and the fact that our approach (detailed
below) might be incorrect.]
Cliff Green <clgreen at nsslsun.gcn.uoknor.edu> writes:
>I'm getting somewhat frustrated in making a fairly complex package I'm
>working on to be portable. ...
>...? I appreciate all
>the help you can give this standards novice.
We're attempting to solve just this portability problem through the use
of platform- (i.e. operating-system and compiler) dependent header-files
and interface libraries. For example, a program might have at its top
#include "udposix.h"
#include <stdlib.h>
...
and, if necessary, we supply the <stdlib.h> header-file, which might
include system-supplied header files as well as defining/declaring any
missing items. The coding style is a subset of that allowed by the
union of Standard C and POSIX. Function prototypes are supported on
appropriate platforms.
The code would be compiled by something akin to
cc -I$(UNIDATA_INC) <program>.c -L$(UNIDATA_LIB) -ludposix ...
where the `udposix' library is also supplied by us (it's empty on some
platforms). Missing functions are created and incorporated into the
library on an as-needed basis.
Supported platforms include AIX 3.1, SunOS 4.0.3, SunOS 4.1,
SunOS 4.1.1, Ultrix 3.5, Ultrix 4.0, UNICOS 5.1.9, and VMS 5.3.
If you'd like more information, give me a buzz.
Steve Emmerson steve at unidata.ucar.edu ...!ncar!unidata!steve
More information about the Comp.std.c
mailing list