YARP
Yet Another Robot Platform
numeric.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2019 Istituto Italiano di Tecnologia (IIT)
3  * All rights reserved.
4  *
5  * This software may be modified and distributed under the terms of the
6  * BSD-3-Clause license. See the accompanying LICENSE file for details.
7  */
8 
9 #ifndef YARP_CONFIG_NUMERIC_H
10 #define YARP_CONFIG_NUMERIC_H
11 
12 #define YARP_HAS_SYS_TYPES_H
13 
14 #if defined(YARP_HAS_SYS_TYPES_H)
15 # include <sys/types.h>
16 #endif
17 
18 #include <cstddef>
19 #include <cstdint>
20 #include <cfloat>
21 #include <cinttypes>
22 #if defined (_MSC_VER)
23 # include <BaseTsd.h>
24 #endif
25 
26 /* #undef YARP_BIG_ENDIAN */
27 #define YARP_LITTLE_ENDIAN
28 
29 #define YARP_HAS_FLOAT128_T
30 #define YARP_FLOAT32_IS_IEC559 1
31 #define YARP_FLOAT64_IS_IEC559 1
32 #define YARP_FLOAT128_IS_IEC559 1
33 
34 // Ensure that float32_t, float64_t, and float128_t are not defined by some
35 // other header, included before this one.
36 #if defined(float32_t)
37 # undef float32_t
38 #endif
39 #if defined(float64_t)
40 # undef float64_t
41 #endif
42 #if defined(float128_t)
43 # undef float128_t
44 #endif
45 
46 
47 namespace yarp {
48 namespace conf {
49 
50 typedef float float32_t;
51 typedef double float64_t;
52 typedef std::int32_t vocab32_t;
53 #if defined(YARP_HAS_FLOAT128_T)
54 typedef long double float128_t;
55 #endif
56 
57 #if defined (_MSC_VER)
58 typedef ::SSIZE_T ssize_t;
59 #else
61 #endif
62 
63 } // namespace conf
64 } // namespace yarp
65 
66 
67 #define YARP_FLT_EXP_DIG 3
68 #define YARP_DBL_EXP_DIG 4
69 #define YARP_LDBL_EXP_DIG 5
70 
71 
72 #ifndef YARP_NO_DEPRECATED // since YARP 3.0.0
73 #include <yarp/conf/api.h> // For YARP_DEPRECATED_TYPEDEF_MSG
74 YARP_DEPRECATED_TYPEDEF_MSG("Use std::int8_t instead") std::int8_t YARP_INT8;
75 YARP_DEPRECATED_TYPEDEF_MSG("Use std::int16_t instead") std::int16_t YARP_INT16;
76 YARP_DEPRECATED_TYPEDEF_MSG("Use std::int32_t instead") std::int32_t YARP_INT32;
77 YARP_DEPRECATED_TYPEDEF_MSG("Use std::int64_t instead") std::int64_t YARP_INT64;
81 #define YARP_INT32_FMT PRId32
82 #define YARP_INT64_FMT PRId64
83 #endif // YARP_NO_DEPRECATED
84 
85 
86 #endif
yarp::conf::float64_t YARP_FLOAT64
Definition: numeric.h:79
std::int16_t YARP_INT16
Definition: numeric.h:75
long double float128_t
Definition: numeric.h:54
::ssize_t ssize_t
Definition: numeric.h:60
#define YARP_DEPRECATED_TYPEDEF_MSG(x)
Definition: api.h:102
STL namespace.
std::int32_t vocab32_t
Definition: numeric.h:52
The main, catch-all namespace for YARP.
Definition: numeric.h:47
std::int8_t YARP_INT8
Definition: numeric.h:74
std::int32_t YARP_INT32
Definition: numeric.h:76
yarp::conf::ssize_t YARP_SSIZE_T
Definition: numeric.h:80
double float64_t
Definition: numeric.h:51
float float32_t
Definition: numeric.h:50
std::int64_t YARP_INT64
Definition: numeric.h:77
yarp::conf::float32_t YARP_FLOAT32
Definition: numeric.h:78