123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- #ifndef BOOST_CHARCONV_DETAIL_MEMCPY_HPP
- #define BOOST_CHARCONV_DETAIL_MEMCPY_HPP
- #include <boost/charconv/detail/config.hpp>
- #include <cstring>
- #include <cstdint>
- #if defined(__GNUC__) && __GNUC__ >= 10
- # pragma GCC diagnostic push
- # pragma GCC diagnostic ignored "-Wstringop-overflow"
- # define BOOST_CHARCONV_STRINGOP_OVERFLOW_DISABLED
- #endif
- namespace boost { namespace charconv { namespace detail {
- #if !defined(BOOST_CHARCONV_NO_CONSTEXPR_DETECTION) && defined(BOOST_CXX14_CONSTEXPR)
- #define BOOST_CHARCONV_CONSTEXPR constexpr
- constexpr char* memcpy(char* dest, const char* src, std::size_t count)
- {
- if (BOOST_CHARCONV_IS_CONSTANT_EVALUATED(count))
- {
- for (std::size_t i = 0; i < count; ++i)
- {
- *(dest + i) = *(src + i);
- }
- return dest;
- }
- else
- {
-
-
-
- #if defined(__GNUC__) && __GNUC__ == 11
- for (std::size_t i = 0; i < count; ++i)
- {
- *(dest + i) = *(src + i);
- }
- return dest;
- #else
- return static_cast<char*>(std::memcpy(dest, src, count));
- #endif
- }
- }
- #else
- #define BOOST_CHARCONV_CONSTEXPR inline
- inline void* memcpy(void* dest, const void* src, std::size_t count)
- {
- return std::memcpy(dest, src, count);
- }
- #endif
- }}}
- #ifdef BOOST_CHARCONV_STRINGOP_OVERFLOW_DISABLED
- # pragma GCC diagnostic pop
- #endif
- #endif
|