summaryrefslogblamecommitdiff
path: root/user/exiv2/0000-pthread-init-fix.patch
blob: ac69b14c10225f4f4bfb2d0ef956164f163a75a0 (plain) (tree)




























                                                                       
From 620ef04e96f4c0d0894d976fc361588b6526a116 Mon Sep 17 00:00:00 2001
From: clanmills <robin@clanmills.com>
Date: Tue, 20 Jun 2017 20:41:30 +0100
Subject: [PATCH] https://github.com/Exiv2/exiv2/issues/9 Fix submitted.

---
 src/actions.cpp       | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/actions.cpp b/src/actions.cpp
index 0ebe8505..17444c5b 100644
--- a/src/actions.cpp
+++ b/src/actions.cpp
@@ -2045,9 +2045,13 @@ namespace {
 #else
  /* Unix/Linux/Cygwin/MacOSX */
  #include <pthread.h>
+ /* This is the critical section object (statically allocated). */
  #if defined(__APPLE__)
-  /* This is the critical section object (statically allocated). */
-  static pthread_mutex_t cs =  PTHREAD_RECURSIVE_MUTEX_INITIALIZER;
+  #if defined(PTHREAD_RECURSIVE_MUTEX_INITIALIZER)
+    static pthread_mutex_t cs =  PTHREAD_RECURSIVE_MUTEX_INITIALIZER;
+   #else
+    static pthread_mutex_t cs =  PTHREAD_MUTEX_INITIALIZER;
+  #endif
  #else
   static pthread_mutex_t cs =  PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
  #endif