Commit d1bc565c authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

Simplify injection of extra attributes into cfortran routines.

parent 48b98b34
......@@ -1211,6 +1211,7 @@ typedef void (*cfCAST_FUNCTION)(CF_VOID_PROTO);
#define CFextern extern
#endif
#define CFattributes
#ifdef CFSUBASFUN
#define PROTOCCALLSFSUB0(UN,LN) \
......@@ -2490,18 +2491,20 @@ string. */
#ifndef __CF__KnR
#if defined(AbsoftUNIXFortran) || defined(AbsoftProFortran)
#define FCALLSCFUN0(T0,CN,UN,LN) CFextern _(T0,_cfFZ)(UN,LN) ABSOFT_cf2(T0)); \
CFextern _(T0,_cfFZ)(UN,LN) ABSOFT_cf2(T0)) \
#define FCALLSCFUN0(T0,CN,UN,LN) CFextern _(T0,_cfFZ)(UN,LN) ABSOFT_cf2(T0)) \
CFattributes; \
CFextern _(T0,_cfFZ)(UN,LN) ABSOFT_cf2(T0)) \
{_Icf(2,UU,T0,A0,0); _Icf(0,L,T0,0,0) CN(); _Icf(0,K,T0,0,0) _(T0,_cfI)}
#else
#define FCALLSCFUN0(T0,CN,UN,LN) CFextern _(T0,_cfFZ)(UN,LN)); \
#define FCALLSCFUN0(T0,CN,UN,LN) CFextern _(T0,_cfFZ)(UN,LN)) CFattributes; \
CFextern _(T0,_cfFZ)(UN,LN)) \
{_Icf(2,UU,T0,A0,0); _Icf(0,L,T0,0,0) CN(); _Icf(0,K,T0,0,0) _(T0,_cfI)}
#endif
#define FCALLSCFUN14(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) \
CFextern _(T0,_cfF)(UN,LN) \
CFARGT14(NCF,DCF,ABSOFT_cf2(T0),T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) ); \
CFARGT14(NCF,DCF,ABSOFT_cf2(T0),T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) ) \
CFattributes; \
CFextern _(T0,_cfF)(UN,LN) \
CFARGT14(NCF,DCF,ABSOFT_cf2(T0),T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) ) \
{ CFARGT14S(QCF,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) \
......@@ -2513,7 +2516,8 @@ string. */
#define FCALLSCFUN27(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR) \
CFextern _(T0,_cfF)(UN,LN) \
CFARGT27(NCF,DCF,ABSOFT_cf2(T0),T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR) ); \
CFARGT27(NCF,DCF,ABSOFT_cf2(T0),T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR) ) \
CFattributes; \
CFextern _(T0,_cfF)(UN,LN) \
CFARGT27(NCF,DCF,ABSOFT_cf2(T0),T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR) ) \
{ CFARGT27S(QCF,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR) \
......
......@@ -101,19 +101,12 @@ abort_f(MPI_Fint *comm_f, const char *msg,
SymPrefix(abort)(comm_c, msg, source, line);
}
#ifndef __CF__KnR
# undef PROTOCCALLSFSUB14
# define PROTOCCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) \
_(VOID,_cfPU)(CFC_(UN,LN))( CFARGT14(NCF,KCF,_Z,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) ) \
__attribute__((noreturn));
#endif
#undef CFattributes
#define CFattributes __attribute__((noreturn))
FCALLSCSUB4(abort_f, SYMPREFIX(ABORT), symprefix(abort),
PVOID, STRING, STRING, INT)
#ifndef __CF__KnR
# undef PROTOCCALLSFSUB14
# define PROTOCCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) \
_(VOID,_cfPU)(CFC_(UN,LN))( CFARGT14(NCF,KCF,_Z,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) );
#endif
#undef CFattributes
#define CFattributes
static void
SymPrefix(abort_handler_wrapper)(MPI_Comm comm, const char msg[],
......@@ -154,20 +147,13 @@ FCALLSCSUB0(SymPrefix(restore_default_abort_handler),
SYMPREFIX(RESTORE_DEFAULT_ABORT_HNDL),
symprefix(restore_default_abort_hndl))
#ifndef __CF__KnR
# undef PROTOCCALLSFSUB14
# define PROTOCCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) \
_(VOID,_cfPU)(CFC_(UN,LN))( CFARGT14(NCF,KCF,_Z,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) ) \
__attribute__((noreturn));
#endif
#undef CFattributes
#define CFattributes __attribute__((noreturn))
FCALLSCSUB4(abort_default_f,SYMPREFIX(ABORT_DEFAULT),
symprefix(abort_default),
PVOID,STRING,STRING,INT)
#ifndef __CF__KnR
# undef PROTOCCALLSFSUB14
# define PROTOCCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) \
_(VOID,_cfPU)(CFC_(UN,LN))( CFARGT14(NCF,KCF,_Z,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) );
#endif
#undef CFattributes
#define CFattributes
/* this must be the last piece of code in the file because we
* redefine a cfortran.h internal here, to allow calls to Fortran
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment