Allow setting type of Real at compilation time
[ipdf/code.git] / src / real.h
1 #ifndef _REAL_H
2 #define _REAL_H
3
4 #include "common.h"
5
6 #define REAL_SINGLE 0
7 #define REAL_DOUBLE 1
8
9 #ifndef REAL
10         #error "REAL was not defined!"
11 #endif
12
13
14 namespace IPDF
15 {       
16         extern const char * g_real_name[];
17
18 #if REAL == REAL_SINGLE
19         typedef float Real;
20         inline float Float(Real r) {return r;}
21 #elif REAL == REAL_DOUBLE
22         typedef double Real;
23         inline double Float(Real r) {return r;}
24 #else
25         #error "Type of Real unspecified."
26 #endif //REAL
27
28 }
29
30 #endif //_REAL_H

UCC git Repository :: git.ucc.asn.au