Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #include <limits>
00018 #include <cmath>
00019
00020 #ifndef G2O_MACROS_H
00021 #define G2O_MACROS_H
00022
00023 #ifndef DEG2RAD
00024 #define DEG2RAD(x) ((x) * 0.01745329251994329575)
00025 #endif
00026
00027 #ifndef RAD2DEG
00028 #define RAD2DEG(x) ((x) * 57.29577951308232087721)
00029 #endif
00030
00031 #if defined(__GNUC__)
00032 # define G2O_ATTRIBUTE_CONSTRUCTOR __attribute__ ((constructor))
00033 # define G2O_ATTRIBUTE_UNUSED __attribute__((unused))
00034 # define G2O_ATTRIBUTE_FORMAT12 __attribute__ ((format (printf, 1, 2)))
00035 # define G2O_ATTRIBUTE_FORMAT23 __attribute__ ((format (printf, 2, 3)))
00036 #else
00037 # ifndef __PRETTY_FUNCTION__
00038 # define __PRETTY_FUNCTION__ ""
00039 # endif
00040 # define G2O_ATTRIBUTE_CONSTRUCTOR
00041 # define G2O_ATTRIBUTE_UNUSED
00042 # define G2O_ATTRIBUTE_FORMAT12
00043 # define G2O_ATTRIBUTE_FORMAT23
00044 #endif
00045
00046 inline bool g2o_isnan(double x)
00047 {
00048 #if defined(__GNUC__)
00049 return std::isnan(x);
00050 #else
00051 return x != x;
00052 #endif
00053 }
00054
00055
00056 #ifdef __cplusplus
00057
00058 #define G2O_FSKIP_LINE(f) \
00059 {char c=' ';while(c != '\n' && f.good() && !(f).eof()) (f).get(c);}
00060
00061 #ifndef PVAR
00062 #define PVAR(s) \
00063 #s << " = " << (s) << std::flush
00064 #endif
00065
00066 #ifndef FIXED
00067 #define FIXED(s) \
00068 std::fixed << s << std::resetiosflags(std::ios_base::fixed)
00069 #endif
00070
00071 #endif // __cplusplus
00072
00073 #endif