FEDEM Solver  R8.0
Source code of the dynamics solver
FFaFortran.H
Go to the documentation of this file.
1 /* SPDX-FileCopyrightText: 2023 SAP SE
2  *
3  * SPDX-License-Identifier: Apache-2.0
4  *
5  * This file is part of FEDEM - https://openfedem.org
6  */
12 #ifndef FFA_FORTRAN_H
13 #define FFA_FORTRAN_H
14 
19 #if defined(win32) || defined(win64)
20 #if defined(FT_HAS_INT4_ONLY)
21 #define f90_int8 __int32
22 #else
23 #define f90_int8 __int64
24 #endif
25 #elif defined(irix)
26 #define f90_int8 long long
27 #elif defined(hpux)
28 #define f90_int8 off64_t
29 #else
30 #define f90_int8 long
31 #endif
32 
36 #if defined(FT_USE_INT8)
37 #define f90_int f90_int8
38 #else
39 #define f90_int int
40 #endif
41 
46 #if defined(irix64) || defined(hpux64) || defined(aix64) || defined(win64) || defined(linux64)
47 #define ptr_int f90_int8
48 #else
49 #define ptr_int int
50 #endif
51 
58 #if defined(win32) || defined(win64)
59 #define F90_NAME(name,NAME) NAME
60 #elif defined(hpux) || defined(aix) || defined(aix64)
61 #define F90_NAME(name,NAME) name
62 #else
63 #define F90_NAME(name,NAME) name##_
64 #endif
65 
67 #if _MSC_VER > 1300
68 #define _CPFX _cdecl
69 #elif defined(win32)
70 #define _CPFX _stdcall
71 #define _NCHAR_AFTER_CHARARG
72 #else
73 #define _CPFX
74 #endif
75 
77 #ifdef __cplusplus
78 #define F90_FUNCTION(type,name,NAME) extern "C" type _CPFX F90_NAME(name,NAME)
79 #else
80 #define F90_FUNCTION(type,name,NAME) type _CPFX F90_NAME(name,NAME)
81 #endif
82 
83 
85 #define SUBROUTINE(name,NAME) F90_FUNCTION(void,name,NAME)
87 #define PTR_FUNCTION(name,NAME) F90_FUNCTION(void*,name,NAME)
89 #define INTEGER_FUNCTION(name,NAME) F90_FUNCTION(f90_int,name,NAME)
91 #define REAL_FUNCTION(name,NAME) F90_FUNCTION(float,name,NAME)
93 #define DOUBLE_FUNCTION(name,NAME) F90_FUNCTION(double,name,NAME)
94 
95 #endif