Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
dkrz-sw
yaxt
Commits
5dc2ba02
Commit
5dc2ba02
authored
Feb 12, 2021
by
Thomas Jahns
🤸
Browse files
Correctly declare Fortran procedure interface via cfortran.h
parent
86099f42
Changes
1
Hide whitespace changes
Inline
Side-by-side
include/cfortran.h
View file @
5dc2ba02
...
...
@@ -402,10 +402,12 @@ only C calling FORTRAN subroutines will work using K&R style.*/
#ifndef apolloFortran
#define COMMON_BLOCK_DEF(DEFINITION, NAME) extern DEFINITION NAME
#define CF_NULL_PROTO
#define CF_NULL_PROTO void
#define CF_VOID_PROTO void
#else
/* HP doesn't understand #elif. */
/* Without ANSI prototyping, Apollo promotes float functions to double. */
/* Note that VAX/VMS, IBM, Mips choke on 'type function(...);' prototypes. */
#define CF_VOID_PROTO void
#define CF_NULL_PROTO ...
#ifndef __CF__APOLLO67
#define COMMON_BLOCK_DEF(DEFINITION, NAME) \
...
...
@@ -766,7 +768,7 @@ return (int)num;
while the following equivalent typedef is fine.
For consistency use the typedef on all machines.
*/
typedef
void
(
*
cfCAST_FUNCTION
)(
CF_
NULL
_PROTO
);
typedef
void
(
*
cfCAST_FUNCTION
)(
CF_
VOID
_PROTO
);
#define VCF(TN,I) _Icf4(4,V,TN,_(A,I),_(B,I),F)
#define VVCF(TN,AI,BI) _Icf4(4,V,TN,AI,BI,S)
...
...
@@ -781,7 +783,7 @@ typedef void (*cfCAST_FUNCTION)(CF_NULL_PROTO);
#define PINT_cfV( T,A,B,F) _(T,_cfVP)(A,B)
#define PVOID_cfV( T,A,B,F)
#if defined(apolloFortran) || defined(hpuxFortran800) || defined(AbsoftUNIXFortran) || defined(AbsoftProFortran)
#define ROUTINE_cfV(T,A,B,F) void (*B)(CF_
NULL
_PROTO) = (cfCAST_FUNCTION)A;
#define ROUTINE_cfV(T,A,B,F) void (*B)(CF_
VOID
_PROTO) = (cfCAST_FUNCTION)A;
#else
#define ROUTINE_cfV(T,A,B,F)
#endif
...
...
@@ -1997,7 +1999,7 @@ for the same function in the same source code. Something done by the experts in
debugging only.*/
#define PROTOCCALLSFFUN0(F,UN,LN) \
_(F,_cfPU)( CFC_(UN,LN))(CF_
NULL
_PROTO); \
_(F,_cfPU)( CFC_(UN,LN))(CF_
VOID
_PROTO); \
static _Icf(2,U,F,CFFUN(UN),0)() {_(F,_cfE) _Icf(3,GZ,F,UN,LN) ABSOFT_cf1(F));_(F,_cfX)}
#define PROTOCCALLSFFUN1( T0,UN,LN,T1) \
...
...
@@ -2030,8 +2032,8 @@ static _Icf(2,U,F,CFFUN(UN),0)() {_(F,_cfE) _Icf(3,GZ,F,UN,LN) ABSOFT_cf1(F));_(
/* HP/UX 9.01 cc requires the blank between '_Icf(3,G,T0,UN,LN) CCCF(T1,1,0)' */
#ifndef __CF__KnR
#define PROTOCCALLSFFUN14(T0,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)
\
_(T0,_cfPU)(CFC_(UN,LN))(CF
_NULL_PROTO
); static _Icf(2,U,T0,CFFUN(UN),0)(
\
#define PROTOCCALLSFFUN14(T0,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) \
_(T0,_cfPU)(CFC_(UN,LN))(CF
ARGT14(NCF,DCF,ABSOFT_cf2(T0),T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)
); static _Icf(2,U,T0,CFFUN(UN),0)( \
CFARGT14FS(UCF,HCF,_Z,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) ) \
{ CFARGT14S(VCF,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) _(T0,_cfE) \
CCF(LN,T1,1) CCF(LN,T2,2) CCF(LN,T3,3) CCF(LN,T4,4) CCF(LN,T5,5) \
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment