File tree Expand file tree Collapse file tree
olp-cpp-sdk-core/include/olp/core/porting Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3434#endif
3535
3636#ifndef THROW_OR_ABORT
37- # if __cpp_exceptions
38- # define THROW_OR_ABORT (exception ) (throw (exception))
39- # else
40- # include < cstdlib>
41- # define THROW_OR_ABORT (exception ) \
42- do { \
43- (void )exception; \
44- std::abort (); \
45- } while (0 )
46- # endif
37+ #if __cpp_exceptions
38+ #define THROW_OR_ABORT (exception ) (throw (exception))
39+ #else
40+ #include < cstdlib>
41+ #define THROW_OR_ABORT (exception ) \
42+ do { \
43+ (void )exception; \
44+ std::abort (); \
45+ } while (0 )
46+ #endif
4747#endif
4848
4949namespace std {
5050namespace detail {
5151
5252// C++11 compatible std::exchange
53- template <class T , class U = T>
54- T
55- exchange (T& obj, U&& new_value)
56- {
53+ template <class T , class U = T>
54+ T exchange (T& obj, U&& new_value) {
5755 T old_value = std::move (obj);
5856 obj = std::forward<U>(new_value);
5957 return old_value;
@@ -341,6 +339,15 @@ class shared_mutex {
341339#endif
342340};
343341
342+ } // namespace std
343+
344+ // `std::shared_lock` is available since C++14
345+ #if ((__cplusplus >= 201402L) || (defined(_MSC_VER) && _MSC_VER >= 1900))
346+ #include < shared_mutex>
347+ #else
348+
349+ namespace std {
350+
344351template <typename Mutex>
345352/* *
346353 * @brief A shared mutex wrapper that supports timed lock operations
@@ -556,6 +563,7 @@ void swap(shared_lock<_Mutex>& __x, shared_lock<_Mutex>& __y) noexcept {
556563}
557564
558565} // namespace std
566+ #endif
559567
560568#if defined(HAVE_PTHREAD_RWLOCK)
561569#undef HAVE_PTHREAD_RWLOCK
You can’t perform that action at this time.
0 commit comments