* Mixed Fortran/C porting UNIX -> VMS headache
@ 1993-01-26 19:16 JONES,FRED_W.
1993-01-30 7:04 ` pettengill
0 siblings, 1 reply; 2+ messages in thread
From: JONES,FRED_W. @ 1993-01-26 19:16 UTC (permalink / raw)
[cross-posted to comp.os.vms]
I have a large mixed Fortran/C application that has to run on
both Unix systems and VMS. On all the Unix systems I have used,
the Fortran compiler adds an underscore (_) to the end of all
global symbol names. Thus the declarations look like, e.g.:
COMMON/EDGR_MX/MX,XDIG,YDIG,CODE
LOGICAL MX
REAL XDIG,YDIG
BYTE CODE
...
CALL MXSHELL(I,A)
...
struct {Bool mx; float xdig, ydig; char code;} edgr_mx_;
...
void mxshell_(i, a)
int *i;
float *a;
{
[...etc.]
Unfortunately, VMS does not add the underscore suffix to the references,
rendering this type of application fundamentally non-source-code-portable
to VMS systems.
Thus the programmer is forced to use abominations like:
#ifdef VMS
struct {Bool mx; float xdig, ydig; char code;} edgr_mx;
#else
struct {Bool mx; float xdig, ydig; char code;} edgr_mx_;
#endif
...
#ifdef VMS
void mxshell(i, a)
#else
void mxshell_(i, a)
#endif
int *i;
float *a;
{
[...etc.]
One could make jackets for all the C routines, but that still leaves
the common blocks.
Any DEC/VMS gurus know of a more elegant solution?
Thanks
Frederick Jones
fwj@reg.triumf.ca
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Mixed Fortran/C porting UNIX -> VMS headache
1993-01-26 19:16 Mixed Fortran/C porting UNIX -> VMS headache JONES,FRED_W.
@ 1993-01-30 7:04 ` pettengill
0 siblings, 0 replies; 2+ messages in thread
From: pettengill @ 1993-01-30 7:04 UTC (permalink / raw)
In article <26JAN199311160883@reg.triumf.ca>, fwj@reg.triumf.ca (JONES,FRED_W.) writes:
|>
|>I have a large mixed Fortran/C application that has to run on
|>both Unix systems and VMS. On all the Unix systems I have used,
|>the Fortran compiler adds an underscore (_) to the end of all
|>global symbol names. Thus the declarations look like, e.g.:
|>
|> COMMON/EDGR_MX/MX,XDIG,YDIG,CODE
|> LOGICAL MX
|> REAL XDIG,YDIG
|> BYTE CODE
|> ...
|> CALL MXSHELL(I,A)
|> ...
|>
|>struct {Bool mx; float xdig, ydig; char code;} edgr_mx_;
|> ...
|>void mxshell_(i, a)
|> int *i;
|> float *a;
|>{
|> [...etc.]
|>
|>
|>Unfortunately, VMS does not add the underscore suffix to the references,
|>rendering this type of application fundamentally non-source-code-portable
|>to VMS systems.
|>
|>Thus the programmer is forced to use abominations like:
|>
|>#ifdef VMS
|>struct {Bool mx; float xdig, ydig; char code;} edgr_mx;
|>#else
|>struct {Bool mx; float xdig, ydig; char code;} edgr_mx_;
|>#endif
|> ...
|>#ifdef VMS
|>void mxshell(i, a)
|>#else
|>void mxshell_(i, a)
|>#endif
|> int *i;
|> float *a;
|>{
|> [...etc.]
|>
|>One could make jackets for all the C routines, but that still leaves
|>the common blocks.
|>
|>Any DEC/VMS gurus know of a more elegant solution?
|>
How about
#define foo_ foo
#define bar_ bar
in a VMS specific version of `os_defs.h'
mulp
DEC CVG - I break clusters, I don't write C
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~1993-01-30 7:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1993-01-26 19:16 Mixed Fortran/C porting UNIX -> VMS headache JONES,FRED_W.
1993-01-30 7:04 ` pettengill
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox