mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-17 15:37:34 +08:00
55 lines
932 B
C++
55 lines
932 B
C++
/*
|
|
* Copyright (C) 2014 Pavel Kirienko <pavel.kirienko@gmail.com>
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <uavcan/build_config.hpp>
|
|
|
|
#if !defined(UAVCAN_CPP_VERSION) || !defined(UAVCAN_CPP11)
|
|
# error UAVCAN_CPP_VERSION
|
|
#endif
|
|
|
|
#if UAVCAN_CPP_VERSION >= UAVCAN_CPP11
|
|
|
|
# include <cstdint>
|
|
|
|
namespace uavcan
|
|
{
|
|
|
|
typedef std::uint8_t uint8_t;
|
|
typedef std::uint16_t uint16_t;
|
|
typedef std::uint32_t uint32_t;
|
|
typedef std::uint64_t uint64_t;
|
|
|
|
typedef std::int8_t int8_t;
|
|
typedef std::int16_t int16_t;
|
|
typedef std::int32_t int32_t;
|
|
typedef std::int64_t int64_t;
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
/*
|
|
* C++03 doesn't define standard integer types, so we pull it from the C library as a workaround.
|
|
*/
|
|
# include <stdint.h>
|
|
|
|
namespace uavcan
|
|
{
|
|
|
|
typedef ::uint8_t uint8_t;
|
|
typedef ::uint16_t uint16_t;
|
|
typedef ::uint32_t uint32_t;
|
|
typedef ::uint64_t uint64_t;
|
|
|
|
typedef ::int8_t int8_t;
|
|
typedef ::int16_t int16_t;
|
|
typedef ::int32_t int32_t;
|
|
typedef ::int64_t int64_t;
|
|
|
|
}
|
|
|
|
#endif
|