aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/include/std/condition_variable
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2018-07-26 15:01:55 +0100
committerJonathan Wakely <redi@gcc.gnu.org>2018-07-26 15:01:55 +0100
commit8ba7f29e3dd0640f3b40f60f57d1f491c6d35a74 (patch)
tree55e1acb98e009a524192df17448affcee3fff247 /libstdc++-v3/include/std/condition_variable
parent864f020a10a8517a01abbcad71d22619477358f7 (diff)
downloadgcc-8ba7f29e3dd0640f3b40f60f57d1f491c6d35a74.zip
gcc-8ba7f29e3dd0640f3b40f60f57d1f491c6d35a74.tar.gz
gcc-8ba7f29e3dd0640f3b40f60f57d1f491c6d35a74.tar.bz2
Remove <chrono> dependency on _GLIBCXX_USE_C99_STDINT_TR1
By adding fallback definitions of std::intmax_t and std::uintmax_t it's possible to define <ratio> without _GLIBCXX_USE_C99_STDINT_TR1. This in turn allows most of <chrono> to be defined, which removes the dependency on _GLIBCXX_USE_C99_STDINT_TR1 for all of the C++11 concurrency features. The compiler defines __INTMAX_TYPE__ and __UINTMAX_TYPE__ unconditionally so it should be safe to rely on them. * include/bits/atomic_futex.h [!_GLIBCXX_USE_C99_STDINT_TR1] (__atomic_futex_unsigned_base): Remove dependency on _GLIBCXX_USE_C99_STDINT_TR1 macro. * include/bits/unique_lock.h [!_GLIBCXX_USE_C99_STDINT_TR1] (unique_lock): Remove dependency on _GLIBCXX_USE_C99_STDINT_TR1. * include/c_global/cstdint [!_GLIBCXX_USE_C99_STDINT_TR1] (intmax_t) (uintmax_t): Define using predefined macros. * include/std/chrono [!_GLIBCXX_USE_C99_STDINT_TR1] (duration) (time_point, system_clock, high_resolution_clock, steady_clock): Remove dependency on _GLIBCXX_USE_C99_STDINT_TR1 macro. (nanoseconds, microseconds, milliseconds, seconds, minutes, hours): [!_GLIBCXX_USE_C99_STDINT_TR1]: Define using __INT64_TYPE__ or long long when <stdint.h> is not usable. * include/std/condition_variable [!_GLIBCXX_USE_C99_STDINT_TR1] (condition_variable, condition_variable_any): Remove dependency on _GLIBCXX_USE_C99_STDINT_TR1. * include/std/future [!_GLIBCXX_USE_C99_STDINT_TR1] (future, promise) (packaged_task, async): Likewise. * include/std/mutex [!_GLIBCXX_USE_C99_STDINT_TR1] (recursive_mutex) (timed_mutex, recursive_timed_mutex, try_lock, lock, scoped_lock) (once_flag, call_once): Likewise. * include/std/ratio [!_GLIBCXX_USE_C99_STDINT_TR1] (ratio): Likewise. * include/std/shared_mutex [!_GLIBCXX_USE_C99_STDINT_TR1] (shared_mutex, shared_timed_mutex, shared_lock): Likewise. * include/std/thread [!_GLIBCXX_USE_C99_STDINT_TR1] (thread) (this_thread::get_id, this_thread::yield, this_thread::sleep_for) (this_thread::sleep_until): Likewise. * src/c++11/chrono.cc: Remove dependency on _GLIBCXX_USE_C99_STDINT_TR1 macro. * src/c++11/condition_variable.cc: Likewise. * src/c++11/futex.cc: Likewise. * src/c++11/future.cc: Likewise. * src/c++11/mutex.cc: Likewise. * src/c++11/thread.cc: Likewise. * testsuite/20_util/duration/literals/range_neg.cc: Adjust dg-error. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Likewise. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Likewise. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Likewise. * testsuite/20_util/ratio/cons/cons_overflow_neg.cc: Likewise. * testsuite/20_util/ratio/operations/ops_overflow_neg.cc: Likewise. From-SVN: r263001
Diffstat (limited to 'libstdc++-v3/include/std/condition_variable')
-rw-r--r--libstdc++-v3/include/std/condition_variable6
1 files changed, 2 insertions, 4 deletions
diff --git a/libstdc++-v3/include/std/condition_variable b/libstdc++-v3/include/std/condition_variable
index 88ab775..3f690c8 100644
--- a/libstdc++-v3/include/std/condition_variable
+++ b/libstdc++-v3/include/std/condition_variable
@@ -45,7 +45,7 @@
#include <bits/shared_ptr.h>
#include <bits/cxxabi_forced.h>
-#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1)
+#if defined(_GLIBCXX_HAS_GTHREADS)
namespace std _GLIBCXX_VISIBILITY(default)
{
@@ -319,8 +319,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace
-#endif // _GLIBCXX_HAS_GTHREADS && _GLIBCXX_USE_C99_STDINT_TR1
-
+#endif // _GLIBCXX_HAS_GTHREADS
#endif // C++11
-
#endif // _GLIBCXX_CONDITION_VARIABLE