portable_types.hpp
Go to the documentation of this file.
1 
8 /*****************************************************************************
9 ** Ifdefs
10 *****************************************************************************/
11 
12 #ifndef ECL_PORTABLE_TYPES_HPP_
13 #define ECL_PORTABLE_TYPES_HPP_
14 
15 /*****************************************************************************
16 ** Includes
17 *****************************************************************************/
18 
19 #include <ecl/config/ecl.hpp>
20 #include <limits>
21 
22 /*****************************************************************************
23 ** Namespaces
24 *****************************************************************************/
25 
26 namespace ecl {
27 
28 /*****************************************************************************
29 ** Integers
30 *****************************************************************************/
31 // If errors show up, need to check the ecl macro logic.
32 #if ECL_SIZE_OF_CHAR == 1
33  typedef char int8;
34  typedef unsigned char uint8;
35 #else
36  #error "ecl::int8 could not be typedef'd (probably faulty ecl logic)."
37 #endif
38 
39 #if ECL_SIZE_OF_SHORT == 2
40  typedef short int16;
41  typedef unsigned short uint16;
42 #else
43  #error "ecl::int16 could not be typedef'd (probably faulty ecl logic)."
44 #endif
45 
46 #if ECL_SIZE_OF_INT == 4
47  typedef int int32;
48  typedef unsigned int uint32;
49 #else
50  #error "ecl::int32 could not be typedef'd (probably faulty ecl logic)."
51 #endif
52 
53 #if ECL_SIZE_OF_LONG == 4
54  typedef long long int64;
55  typedef unsigned long long uint64;
56 #elif ECL_SIZE_OF_LONG == 8
57  typedef long int64;
58  typedef unsigned long uint64;
59 #else
60  #error "ecl::int64 could not be typedef'd (probably faulty ecl logic)."
61 #endif
62 
63 /*****************************************************************************
64 ** Floats
65 *****************************************************************************/
66 
67 #if ECL_SIZE_OF_FLOAT == 4
68  typedef float float32;
69 #else
70  #error "ecl::float32 could not be typedef'd (probably faulty ecl logic)."
71 #endif
72 #if ECL_SIZE_OF_DOUBLE == 8
73  typedef double float64;
74 #elif ECL_SIZE_OF_LONG_DOUBLE == 8
75  typedef long double float64;
76 #else
77  #error "ecl::float64 could not be typedef'd (probably faulty ecl logic)."
78 #endif
79 #if ECL_SIZE_OF_LONG_DOUBLE == 12
80  typedef long double float96;
81 #elif ECL_SIZE_OF_LONG_DOUBLE == 16
82  typedef long double float128;
83 #else
84  #define ECL_LONG_DOUBLE_UNDEFINED
85  #define ECL_LONG_LONG_DOUBLE_UNDEFINED
86  //#error "ecl::float96 could not be typedef'd (probably faulty ecl logic)."
87 #endif
88 
89 } // namespace ecl
90 
91 #endif /* ECL_PORTABLE_TYPES_HPP_ */


ecl_config
Author(s): Daniel Stonier
autogenerated on Mon Feb 28 2022 22:16:09