| // Copyright 2024 The Pigweed Authors |
| // |
| // Licensed under the Apache License, Version 2.0 (the "License"); you may not |
| // use this file except in compliance with the License. You may obtain a copy of |
| // the License at |
| // |
| // https://www.apache.org/licenses/LICENSE-2.0 |
| // |
| // Unless required by applicable law or agreed to in writing, software |
| // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| // License for the specific language governing permissions and limitations under |
| // the License. |
| |
| #pragma once |
| |
| // libc++'s <atomic> includes this file via <__threading_support>. It needs |
| // these types and functions declared, but only for use in interfaces that |
| // aren't supported in Pigweed, so stub declarations are all they need. |
| |
| _LIBCPP_BEGIN_NAMESPACE_STD |
| |
| struct __libcpp_timespec_t { |
| long int tv_sec, tv_nsec; |
| }; |
| |
| using __libcpp_thread_id = int; |
| |
| bool __libcpp_thread_id_equal(__libcpp_thread_id, __libcpp_thread_id); |
| bool __libcpp_thread_id_less(__libcpp_thread_id, __libcpp_thread_id); |
| __libcpp_thread_id __libcpp_thread_get_current_id(); |
| |
| void __libcpp_thread_sleep_for(chrono::nanoseconds); |
| void __libcpp_thread_yield(); |
| |
| // This macro is used unconditionally in <__threading_support> but defined |
| // there only conditionally on when <__external_threading> is not used. |
| #define _LIBCPP_THREAD_ABI_VISIBILITY inline _LIBCPP_INLINE_VISIBILITY |
| |
| using __libcpp_mutex_t = int; |
| using __libcpp_recursive_mutex_t = int; |
| using __libcpp_condvar_t = int; |
| |
| #define _LIBCPP_MUTEX_INITIALIZER {} |
| #define _LIBCPP_CONDVAR_INITIALIZER {} |
| |
| _LIBCPP_END_NAMESPACE_STD |