system-cfortran

Use system cfortran header.


Gbp-Pq: Name 02-system-cfortran.patch
This commit is contained in:
Debian Astronomy Maintainers 2022-05-14 03:24:02 +08:00 committed by openKylinBot
parent 00501b4f2d
commit 76240c4209
1 changed files with 30 additions and 30 deletions

View File

@ -1,6 +1,6 @@
#define UNSIGNED_BYTE #define UNSIGNED_BYTE
#include "cfortran.h" #include <cfortran.h>
/************************************************************************ /************************************************************************
Some platforms creates longs as 8-byte integers. On other machines, ints Some platforms creates longs as 8-byte integers. On other machines, ints
@ -29,16 +29,16 @@
#undef LONGV_cfT #undef LONGV_cfT
#undef PLONG_cfT #undef PLONG_cfT
#define LONGV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,LONGV,A,B,C,D,E) #define LONGV_cfSTR(N,T,A,B,C,D,E) CFORTRAN_XCAT_(CFARGS,N)(T,LONGV,A,B,C,D,E)
#define PLONG_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,PLONG,A,B,C,D,E) #define PLONG_cfSTR(N,T,A,B,C,D,E) CFORTRAN_XCAT_(CFARGS,N)(T,PLONG,A,B,C,D,E)
#define LONGVVVVVVV_cfTYPE int #define LONGVVVVVVV_cfTYPE int
#define PLONG_cfTYPE int #define PLONG_cfTYPE int
#define LONGV_cfQ(B) long *B, _(B,N); #define LONGV_cfQ(B) long *B, CFORTRAN_XCAT_(B,N);
#define PLONG_cfQ(B) long B; #define PLONG_cfQ(B) long B;
#define LONGV_cfT(M,I,A,B,D) ( (_(B,N) = * _3(M,_LONGV_A,I)), \ #define LONGV_cfT(M,I,A,B,D) ( (CFORTRAN_XCAT_(B,N) = * CFORTRAN_XCAT_3(M,_LONGV_A,I)), \
B = F2Clongv(_(B,N),A) ) B = F2Clongv(CFORTRAN_XCAT_(B,N),A) )
#define PLONG_cfT(M,I,A,B,D) ((B=*A),&B) #define PLONG_cfT(M,I,A,B,D) ((B=*A),&B)
#define LONGV_cfR(A,B,D) C2Flongv(_(B,N),A,B); #define LONGV_cfR(A,B,D) C2Flongv(CFORTRAN_XCAT_(B,N),A,B);
#define PLONG_cfR(A,B,D) *A=B; #define PLONG_cfR(A,B,D) *A=B;
#define LONGV_cfH(S,U,B) #define LONGV_cfH(S,U,B)
#define PLONG_cfH(S,U,B) #define PLONG_cfH(S,U,B)
@ -93,7 +93,7 @@ extern unsigned long gMinStrLen;
A->dsc$w_length, \ A->dsc$w_length, \
num_elem(A->dsc$a_pointer, \ num_elem(A->dsc$a_pointer, \
A->dsc$w_length, \ A->dsc$w_length, \
_3(M,_STRV_A,I) ) ) CFORTRAN_XCAT_3(M,_STRV_A,I) ) )
#else #else
#ifdef CRAYFortran #ifdef CRAYFortran
#define PPSTRING_cfT(M,I,A,B,D) (unsigned char*)_fcdtocp(A) #define PPSTRING_cfT(M,I,A,B,D) (unsigned char*)_fcdtocp(A)
@ -103,20 +103,20 @@ extern unsigned long gMinStrLen;
#endif #endif
#define _cfMAX(A,B) ( (A>B) ? A : B ) #define _cfMAX(A,B) ( (A>B) ? A : B )
#define STRINGV_cfQ(B) char **B; unsigned int _(B,N), _(B,M); #define STRINGV_cfQ(B) char **B; unsigned int CFORTRAN_XCAT_(B,N), CFORTRAN_XCAT_(B,M);
#define STRINGV_cfR(A,B,D) free(B[0]); free(B); #define STRINGV_cfR(A,B,D) free(B[0]); free(B);
#define TTSTR( A,B,D) \ #define TTSTR( A,B,D) \
((B=(char*)malloc(_cfMAX(D,gMinStrLen)+1))[D]='\0',memcpy(B,A,D), \ ((B=(char*)malloc(_cfMAX(D,gMinStrLen)+1))[D]='\0',memcpy(B,A,D), \
kill_trailing(B,' ')) kill_trailing(B,' '))
#define TTTTSTRV( A,B,D,E) ( \ #define TTTTSTRV( A,B,D,E) ( \
_(B,N)=_cfMAX(E,1), \ CFORTRAN_XCAT_(B,N)=_cfMAX(E,1), \
_(B,M)=_cfMAX(D,gMinStrLen)+1, \ CFORTRAN_XCAT_(B,M)=_cfMAX(D,gMinStrLen)+1, \
B=(char**)malloc(_(B,N)*sizeof(char*)), \ B=(char**)malloc(CFORTRAN_XCAT_(B,N)*sizeof(char*)), \
B[0]=(char*)malloc(_(B,N)*_(B,M)), \ B[0]=(char*)malloc(CFORTRAN_XCAT_(B,N)*CFORTRAN_XCAT_(B,M)), \
vindex(B,_(B,M),_(B,N),f2cstrv2(A,B[0],D,_(B,M),_(B,N))) \ vindex(B,CFORTRAN_XCAT_(B,M),CFORTRAN_XCAT_(B,N),f2cstrv2(A,B[0],D,CFORTRAN_XCAT_(B,M),CFORTRAN_XCAT_(B,N))) \
) )
#define RRRRPSTRV(A,B,D) \ #define RRRRPSTRV(A,B,D) \
c2fstrv2(B[0],A,_(B,M),D,_(B,N)), \ c2fstrv2(B[0],A,CFORTRAN_XCAT_(B,M),D,CFORTRAN_XCAT_(B,N)), \
free(B[0]), \ free(B[0]), \
free(B); free(B);
@ -169,10 +169,10 @@ static char *f2cstrv2(char *fstr, char* cstr, int felem_len, int celem_len,
#undef BYTE_cfSTR #undef BYTE_cfSTR
#undef BYTEV_cfSTR #undef BYTEV_cfSTR
#define BYTE_cfINT(N,A,B,X,Y,Z) _(CFARGS,N)(A,BYTE,B,X,Y,Z,0) #define BYTE_cfINT(N,A,B,X,Y,Z) CFORTRAN_XCAT_(CFARGS,N)(A,BYTE,B,X,Y,Z,0)
#define BYTEV_cfINT(N,A,B,X,Y,Z) _(CFARGS,N)(A,BYTEV,B,X,Y,Z,0) #define BYTEV_cfINT(N,A,B,X,Y,Z) CFORTRAN_XCAT_(CFARGS,N)(A,BYTEV,B,X,Y,Z,0)
#define BYTE_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,BYTE,A,B,C,D,E) #define BYTE_cfSTR(N,T,A,B,C,D,E) CFORTRAN_XCAT_(CFARGS,N)(T,BYTE,A,B,C,D,E)
#define BYTEV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,BYTEV,A,B,C,D,E) #define BYTEV_cfSTR(N,T,A,B,C,D,E) CFORTRAN_XCAT_(CFARGS,N)(T,BYTEV,A,B,C,D,E)
#define BYTE_cfSEP(T,B) INT_cfSEP(T,B) #define BYTE_cfSEP(T,B) INT_cfSEP(T,B)
#define BYTEV_cfSEP(T,B) INT_cfSEP(T,B) #define BYTEV_cfSEP(T,B) INT_cfSEP(T,B)
#define BYTE_cfH(S,U,B) STRING_cfH(S,U,B) #define BYTE_cfH(S,U,B) STRING_cfH(S,U,B)
@ -211,11 +211,11 @@ static char *f2cstrv2(char *fstr, char* cstr, int felem_len, int celem_len,
#undef LOGICALV_cfSTR #undef LOGICALV_cfSTR
#undef LOGICALV_cfT #undef LOGICALV_cfT
#define LOGICALV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,LOGICALV,A,B,C,D,E) #define LOGICALV_cfSTR(N,T,A,B,C,D,E) CFORTRAN_XCAT_(CFARGS,N)(T,LOGICALV,A,B,C,D,E)
#define LOGICALV_cfQ(B) char *B; unsigned int _(B,N); #define LOGICALV_cfQ(B) char *B; unsigned int CFORTRAN_XCAT_(B,N);
#define LOGICALV_cfT(M,I,A,B,D) (_(B,N)= * _3(M,_LOGV_A,I), \ #define LOGICALV_cfT(M,I,A,B,D) (CFORTRAN_XCAT_(B,N)= * CFORTRAN_XCAT_3(M,_LOGV_A,I), \
B=F2CcopyLogVect(_(B,N),A)) B=F2CcopyLogVect(CFORTRAN_XCAT_(B,N),A))
#define LOGICALV_cfR(A,B,D) C2FcopyLogVect(_(B,N),A,B); #define LOGICALV_cfR(A,B,D) C2FcopyLogVect(CFORTRAN_XCAT_(B,N),A,B);
#define LOGICALV_cfH(S,U,B) #define LOGICALV_cfH(S,U,B)
static char *F2CcopyLogVect(long size, int *A) static char *F2CcopyLogVect(long size, int *A)
@ -268,20 +268,20 @@ extern fitsfile *gFitsFiles[]; /* by Fortran unit numbers */
memchr(A,'\0',D) ? A : TTSTR(A,B,D) memchr(A,'\0',D) ? A : TTSTR(A,B,D)
#define FCALLSCFUN0(T0,CN,UN,LN) \ #define FCALLSCFUN0(T0,CN,UN,LN) \
CFextern _(T0,_cfFZ)(UN,LN) void ABSOFT_cf2(T0)); \ CFextern CFORTRAN_XCAT_(T0,_cfFZ)(UN,LN) void ABSOFT_cf2(T0)); \
CFextern _(T0,_cfFZ)(UN,LN) void ABSOFT_cf2(T0)) \ CFextern CFORTRAN_XCAT_(T0,_cfFZ)(UN,LN) void ABSOFT_cf2(T0)) \
{_Icf(2,UU,T0,A0,0); _Icf(0,L,T0,0,0) CN(); _Icf(0,K,T0,0,0) _(T0,_cfI)} {_Icf(2,UU,T0,A0,0); _Icf(0,L,T0,0,0) CN(); _Icf(0,K,T0,0,0) CFORTRAN_XCAT_(T0,_cfI)}
#define FCALLSCFUN14(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) \ #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) \ CFextern CFORTRAN_XCAT_(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)); \
CFextern _(T0,_cfF)(UN,LN) \ CFextern CFORTRAN_XCAT_(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)) \
{ CFARGT14S(QCF,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) \
_Icf(2,UU,T0,A0,0); _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