amino  1.0-beta2
Lightweight Robot Utility Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
mangle.h
1 #ifndef AA_MANGLE_H
2 #define AA_MANGLE_H
3 
4 #define AA_MANGLE_QUOTE(X) #X
5 
6 #define AA_FORT_MANGLE( sym ) sym ## _
7 #define AA_FORT_MOD_MANGLE( mod, sym ) __ ## mod ## _MOD_ ## sym
8 
9 #define AA_MANGLE_NAME( type, prefix, name ) \
10  aa_ ## prefix ## _ ## type ## _ ## name
11 #define AA_MANGLE_CLA_NAME( type, name ) aa_cla_ ## type ## name
12 #define AA_MANGLE_CBLAS_NAME( type, name ) cblas_ ## type ## name
13 #define AA_MANGLE_LAPACK_NAME( type, name ) type ## name ## _
14 #define AA_MANGLE_FMOD( type, prefix, name ) \
15  aa_ ## prefix ## _mod_ ## type ## _ ## name
16 #define AA_MANGLE_FMOD_F( type, prefix, name ) \
17  AA_FORT_MOD_MANGLE(amino_ ## la, \
18  aa_la_mod_ ## type ##_ ## name ## _c)
19 
20 #define AA_MANGLE_FMOD_C( type, prefix, name ) \
21  AA_MANGLE_FMOD( type, prefix, name ## _c )
22 
23 #define AA_MANGLE_FMOD_BIND_C( type, prefix, fname, ... ) \
24  AA_MANGLE_FMOD( type, prefix, fname ## _c ) (__VA_ARGS__) \
25  bind( C, name=AA_MANGLE_QUOTE( aa_ ## prefix ## _ ## type ## _ ## fname ) )
26 
27 #define AA_MANGLE_FIFACE( prefix, name ) \
28  AA_MANGLE_FMOD(d,prefix,name), AA_MANGLE_FMOD(s,prefix,name)
29 
30 #endif