00001
00002
00003
00004
00005
00006 #ifndef __CHARM_API_H
00007 #define __CHARM_API_H
00008
00009 #include "conv-config.h"
00010
00012 #ifdef __cplusplus
00013 # define CLINKAGE extern "C"
00014 #else
00015 # define CLINKAGE
00016 #endif
00017
00019 #define FLINKAGE CLINKAGE
00020
00021
00022 #undef CDECL
00023 #define CDECL CLINKAGE
00024 #define FDECL FLINKAGE
00025
00028 #if CMK_FORTRAN_USES_ALLCAPS
00029 # define FTN_NAME(caps,nocaps) caps
00030 #elif CMK_FORTRAN_USES_TWOSCORE
00031 # define FTN_NAME(caps,nocaps) nocaps##__
00032 #elif CMK_FORTRAN_USES_ONESCORE
00033 # define FTN_NAME(caps,nocaps) nocaps##_
00034 #elif CMK_FORTRAN_USES_NOSCORE
00035 # define FTN_NAME(caps,nocaps) nocaps
00036 #else
00037
00038 # define FTN_NAME(caps,nocaps) NONMANGLED_##nocaps
00039 #endif
00040
00041
00053 #define FORTRAN_AS_C(CAPITALNAME,Cname,lowername, routine_args,c_args) \
00054 FLINKAGE void \
00055 FTN_NAME(CAPITALNAME,lowername) routine_args { \
00056 Cname c_args;\
00057 }
00058
00062 #define FORTRAN_AS_C_RETURN(returnType, CAPITALNAME,Cname,lowername, routine_args,c_args) \
00063 FLINKAGE returnType \
00064 FTN_NAME(CAPITALNAME,lowername) routine_args { \
00065 return Cname c_args;\
00066 }
00067
00068
00069 #endif
00070