diff options
| author | Man, Jianting (Meco) <[email protected]> | 2022-03-25 11:07:18 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-03-25 23:07:18 +0800 |
| commit | a514b3bd16e4f21202cc001d9294ac2c2f206c3d (patch) | |
| tree | b7663d60d1a5a8f34a83b3ee3625b6c97097718a /components/cplusplus/cpp11/gcc/__utils.h | |
| parent | 851d16b18f0448ee83e069edd5aaa3998e00e284 (diff) | |
[components][kconfig] 整理Kconfig目录名称和结构 (#5698)
Diffstat (limited to 'components/cplusplus/cpp11/gcc/__utils.h')
| -rw-r--r-- | components/cplusplus/cpp11/gcc/__utils.h | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/components/cplusplus/cpp11/gcc/__utils.h b/components/cplusplus/cpp11/gcc/__utils.h deleted file mode 100644 index f9a3c93796..0000000000 --- a/components/cplusplus/cpp11/gcc/__utils.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2006-2021, RT-Thread Development Team - * - * SPDX-License-Identifier: Apache-2.0 - * - * Change Logs: - * Date Author Notes - * 2021-04-27 flybreak the first version. - */ - -#pragma once - -#include <cstdlib> -#include <system_error> -#include <chrono> -#include <ratio> - -#include <rtthread.h> - -#define RT_USING_CPP_EXCEPTION - -inline void throw_system_error(int err, const char *what_msg) -{ -#ifdef RT_USING_CPP_EXCEPTION - throw std::system_error(std::error_code(err, std::system_category()), what_msg); -#else - (void)err; - (void)what_msg; - ::abort(); -#endif -} - -class tick_clock -{ -public: - typedef clock_t rep; - typedef std::ratio<1, RT_TICK_PER_SECOND> period; - - typedef std::chrono::duration<tick_clock::rep, tick_clock::period> duration; - typedef std::chrono::time_point<tick_clock> time_point; - - constexpr static bool is_ready = true; - - static time_point now(); -}; - -class real_time_clock -{ -public: - typedef std::chrono::nanoseconds duration; - typedef duration::rep rep; - typedef duration::period period; - typedef std::chrono::time_point<real_time_clock, duration> time_point; - - static constexpr bool is_steady = true; - - static time_point - now() noexcept; -}; |
