summaryrefslogtreecommitdiffstats
path: root/binutils-2.24/gold/gold-threads.cc
diff options
context:
space:
mode:
Diffstat (limited to 'binutils-2.24/gold/gold-threads.cc')
-rw-r--r--binutils-2.24/gold/gold-threads.cc15
1 files changed, 12 insertions, 3 deletions
diff --git a/binutils-2.24/gold/gold-threads.cc b/binutils-2.24/gold/gold-threads.cc
index 7f203a74..8334a87d 100644
--- a/binutils-2.24/gold/gold-threads.cc
+++ b/binutils-2.24/gold/gold-threads.cc
@@ -284,9 +284,18 @@ Condvar::~Condvar()
class Once_initialize
{
public:
- Once_initialize()
- : once_(PTHREAD_ONCE_INIT)
- { }
+ Once_initialize()
+#if defined(__clang__) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
+ : once_(PTHREAD_ONCE_INIT)
+ { }
+#else
+// In Drawin PTHREAD_ONCE_INIT is {0x30B1BCBA, {0}} and the GCC < 4.4 doesn't support
+// extended initializer list as above */
+ {
+ pthread_once_t once_2 = PTHREAD_ONCE_INIT;
+ once_ = once_2;
+ }
+#endif
// Return a pointer to the pthread_once_t variable.
pthread_once_t*