Mercurial > octave
diff liboctave/cruft/misc/f77-fcn.h @ 22133:59cadee1c74b
new macros for F77 data types
* f77-fcn.h (F77_DBLE, F77_REAL, F77_DBLE_CMPLX, F77_CMPLX, F77_INT,
F77_INT4, F77_LOGICAL): New macros.
* fortrandemo.cc, __pchip_deriv__.cc, dot.cc, interpreter.cc,
ordschur.cc, qz.cc, CColVector.cc, CMatrix.cc, CNDArray.cc,
CRowVector.cc, CSparse.cc, dColVector.cc, dMatrix.cc, dNDArray.cc,
dRowVector.cc, dSparse.cc, fCColVector.cc, fCMatrix.cc,
fCNDArray.cc, fCRowVector.cc, fColVector.cc, fMatrix.cc,
fNDArray.cc, fRowVector.cc, DASPK.cc, DASRT.cc, DASSL.cc, EIG.cc,
LSODE.cc, Quad.cc, aepbalance.cc, chol.cc, eigs-base.cc, fEIG.cc,
gepbalance.cc, hess.cc, lo-specfun.cc, lu.cc, oct-convn.cc,
oct-rand.cc, qr.cc, qrp.cc, randpoisson.cc, schur.cc, svd.cc:
Use new macros in declarations of Fortran subroutines.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sun, 17 Jul 2016 12:42:37 -0400 |
parents | 278fc29b69ca |
children | a51d5c5c71e6 |
line wrap: on
line diff
--- a/liboctave/cruft/misc/f77-fcn.h Sun Jul 17 13:17:58 2016 -0400 +++ b/liboctave/cruft/misc/f77-fcn.h Sun Jul 17 12:42:37 2016 -0400 @@ -113,10 +113,17 @@ F77_CHAR_ARG_USE(s) F77_CHAR_ARG_LEN_USE(s, len) -Use this macro to declare the return type of a C-language function -that is supposed to act like a Fortran subroutine: +Use these macros for C++ code - F77_RET_T int + F77_INT Equivalent to Fortran INTEGER type + F77_INT4 Equivalent to Fortran INTEGER*4 type + F77_DBLE Equivalent to Fortran DOUBLE PRECISION type + F77_REAL Equivalent to Fortran REAL type + F77_CMPLX Equivalent to Fortran COMPLEX type + F77_DBLE_CMPLX Equivalent to Fortran DOUBLE COMPLEX type + F77_LOGICAL Equivalent to Fortran LOGICAL type + F77_RET_T Return type of a C++ function that acts like a + Fortran subroutine. Use these macros to return from C-language functions that are supposed to act like Fortran subroutines. F77_NORETURN is intended to be used @@ -158,8 +165,6 @@ #define F77_CHAR_ARG_USE(s) s.ptr #define F77_CHAR_ARG_LEN_USE(s, len) (s.mask.len >> 3) -/* Use this macro to declare the return type of a C-language function - that is supposed to act like a Fortran subroutine. */ #define F77_RET_T int /* Use these macros to return from C-language functions that are @@ -190,7 +195,7 @@ typedef void *octave_cray_ftn_ch_dsc; -#if defined (__cplusplus) + #if defined (__cplusplus) # define OCTAVE_F77_FCN_INLINE inline #else # define OCTAVE_F77_FCN_INLINE @@ -214,10 +219,8 @@ return *((octave_cray_ftn_ch_dsc *) &desc); } -#if defined (__cplusplus) -# undef OCTAVE_F77_FCN_INLINE -#endif - +#undef OCTAVE_F77_FCN_INLINE + #elif defined (F77_USES_VISUAL_FORTRAN_CALLING_CONVENTION) /* Use these macros to pass character strings from C to Fortran. */ @@ -273,6 +276,14 @@ #endif +#define F77_DBLE double +#define F77_REAL float +#define F77_DBLE_CMPLX Complex +#define F77_CMPLX FloatComplex +#define F77_INT octave_idx_type +#define F77_INT4 int32_t +#define F77_LOGICAL octave_idx_type + /* Build a C string local variable CS from the Fortran string parameter S declared as F77_CHAR_ARG_DEF(s, len) or F77_CONST_CHAR_ARG_DEF(s, len). The string will be cleaned up at the end of the current block.