#ifndef __UT_DECL_HPP__ #define __UT_DECL_HPP__ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef __GLIBC__ #define UT_UNLIKELY(x) __builtin_expect(!!(x), 0) #define UT_LIKELY(x) __builtin_expect(!!(x), 1) #else #define UT_UNLIKELY(x) (x) #define UT_LIKELY(x) (x) #endif//__GLIBC__ #define __UT_CAT(x, y) x##y #define UT_CAT(x, y) __UT_CAT(x, y) #define __UT_STR(x) #x #define UT_STR(x) __UT_STR(x) #define UT_QUEUE_MAX_LEN INT_MAX #define UT_PATH_MAX_LEN 1024 #define UT_THREAD_NAME_MAX_LEN 16 #define UT_DECL_ERR(name, code, desc) \ const int32_t name = code; const std::string name##_DESC = desc; #define UT_DESC_ERR(name) name##_DESC #if defined(__GLIBC__) and defined(__aarch64__) #define gettid() syscall(__NR_gettid) #endif #define UT_SAFE_DEL(x) \ if ((x) != NULL) { delete (x); (x) = NULL; } namespace unitree { namespace common { static const std::string UT_EMPTY_STR = ""; } } #endif//__UT_DECL_HPP__