ltfat.h
1 #ifndef _LTFAT_H
2 #define _LTFAT_H 1
3 
4 #ifndef LTFAT_NOSYSTEMHEADERS
5 #include <string.h>
6 #include <stdlib.h>
7 #include <stddef.h>
8 #include <stdio.h>
9 #ifdef __cplusplus
10 #include <complex>
11 #include <cmath>
12 #else
13 #include <tgmath.h>
14 #endif // notdefined(NOSYSTEMHEADERS)
15 #endif
16 
17 #if defined(__cplusplus) && !defined(LTFAT_CINTERFACE)
18 typedef std::complex<double> ltfat_complex_d;
19 typedef std::complex<float> ltfat_complex_s;
20 #else
21 #if !defined(LTFAT_CINTERFACE) && defined(_Complex_I) && defined(complex) && defined(I)
22 typedef double _Complex ltfat_complex_d;
23 typedef float _Complex ltfat_complex_s;
24 #else
25 typedef double ltfat_complex_d[2];
26 typedef float ltfat_complex_s[2];
27 #endif
28 #endif
29 
30 #ifdef LTFAT_LARGEARRAYS
31 typedef ptrdiff_t ltfat_int;
32 #else
33 typedef int ltfat_int;
34 #endif /* defined(LTFAT_COMPAT32) */
35 
36 #include "ltfat/basicmacros.h"
37 
38 /* BEGIN_C_DECLS */
39 #ifdef __cplusplus
40 extern "C"
41 {
42 #endif
43 
44 #include "ltfat/errno.h"
45 #include "ltfat/version.h"
46 
47 // First, include headers of type (single, double, or complex versions) inert functions
48 #include "ltfat/typeconstant.h"
49 
50 /* -------- Create the single precision routines headers ----- */
51 
52 #ifndef LTFAT_DOUBLE
53 # ifndef LTFAT_SINGLE
54 # define LTFAT_SINGLE_WASNOTDEFINED
55 # define LTFAT_SINGLE
56 # endif
57 
58 # include "ltfat/typecomplexindependent.h"
59 
60 # ifndef LTFAT_COMPLEXTYPE
61 # define LTFAT_COMPLEXTYPE
62 # include "ltfat/typecomplexindependent.h"
63 # undef LTFAT_COMPLEXTYPE
64 # include "ltfat/typeindependent.h"
65 # else
66 # undef LTFAT_COMPLEXTYPE
67 # include "ltfat/typeindependent.h"
68 # include "ltfat/typecomplexindependent.h"
69 # define LTFAT_COMPLEXTYPE
70 # endif
71 
72 # ifdef LTFAT_SINGLE_WASNOTDEFINED
73 # undef LTFAT_SINGLE
74 # undef LTFAT_SINGLE_WASNOTDEFINED
75 # endif
76 #endif
77 
78 
79 /* -------- Create the single precision routines headers ----- */
80 #ifndef LTFAT_SINGLE
81 # ifndef LTFAT_DOUBLE
82 # define LTFAT_DOUBLE_WASNOTDEFINED
83 # define LTFAT_DOUBLE
84 # endif
85 
86 # include "ltfat/typecomplexindependent.h"
87 
88 # ifndef LTFAT_COMPLEXTYPE
89 # define LTFAT_COMPLEXTYPE
90 # include "ltfat/typecomplexindependent.h"
91 # undef LTFAT_COMPLEXTYPE
92 # include "ltfat/typeindependent.h"
93 # else
94 # undef LTFAT_COMPLEXTYPE
95 # include "ltfat/typeindependent.h"
96 # include "ltfat/typecomplexindependent.h"
97 # define LTFAT_COMPLEXTYPE
98 # endif
99 
100 # ifdef LTFAT_DOUBLE_WASNOTDEFINED
101 # undef LTFAT_DOUBLE
102 # undef LTFAT_DOUBLE_WASNOTDEFINED
103 # endif
104 #endif
105 
106 
107 // Undef all
108 #undef LTFAT_COMPLEX
109 #undef LTFAT_REAL
110 #undef LTFAT_TYPE
111 #undef LTFAT_NAME
112 #undef LTFAT_NAME_REAL
113 #undef LTFAT_NAME_COMPLEX
114 #undef LTFAT_FFTW
115 #undef LTFAT_KISS
116 #undef LTFAT_MX_CLASSID
117 #undef LTFAT_MX_COMPLEXITY
118 #undef LTFAT_COMPLEXH
119 
120 
121 #ifdef __cplusplus
122 } // extern "C"
123 #endif
124 /* END_C_DECLS */
125 
126 #endif /* !LTFAT_H */