[vlc-devel] [PATCH] contribs: taglib: Fix invalid atomic support check
Hugo Beauzée-Luyssen
hugo at beauzee.fr
Fri Oct 9 14:34:00 CEST 2015
---
contrib/src/taglib/fix-atomic-checks.patch | 43 ++++++++++++++++++++++++++++++
contrib/src/taglib/rules.mak | 1 +
2 files changed, 44 insertions(+)
create mode 100644 contrib/src/taglib/fix-atomic-checks.patch
diff --git a/contrib/src/taglib/fix-atomic-checks.patch b/contrib/src/taglib/fix-atomic-checks.patch
new file mode 100644
index 0000000..0235d1f
--- /dev/null
+++ b/contrib/src/taglib/fix-atomic-checks.patch
@@ -0,0 +1,43 @@
+--- tablib_orig/taglib/toolkit/trefcounter.h 2015-10-09 14:09:14.162193621 +0200
++++ taglib/taglib/toolkit/trefcounter.h 2015-10-09 14:21:34.406478524 +0200
+@@ -29,21 +29,13 @@
+ #include "taglib_export.h"
+ #include "taglib.h"
+
+-#ifdef __APPLE__
++#if defined(HAVE_MAC_ATOMIC)
+ # include <libkern/OSAtomic.h>
+-# define TAGLIB_ATOMIC_MAC
+-#elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
++#elif defined(HAVE_WIN_ATOMIC)
+ # define NOMINMAX
+ # include <windows.h>
+-# define TAGLIB_ATOMIC_WIN
+-#elif defined (__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 401) \
+- && (defined(__i386__) || defined(__i486__) || defined(__i586__) || \
+- defined(__i686__) || defined(__x86_64) || defined(__ia64)) \
+- && !defined(__INTEL_COMPILER)
+-# define TAGLIB_ATOMIC_GCC
+-#elif defined(__ia64) && defined(__INTEL_COMPILER)
++#elif defined(HAVE_IA64_ATOMIC)
+ # include <ia64intrin.h>
+-# define TAGLIB_ATOMIC_GCC
+ #endif
+
+ #ifndef DO_NOT_DOCUMENT // Tell Doxygen to skip this class.
+@@ -77,13 +69,13 @@
+ public:
+ RefCounterOld() : refCount(1) {}
+
+-#ifdef TAGLIB_ATOMIC_MAC
++#if defined(HAVE_MAC_ATOMIC)
+ void ref() { OSAtomicIncrement32Barrier(const_cast<int32_t*>(&refCount)); }
+ bool deref() { return ! OSAtomicDecrement32Barrier(const_cast<int32_t*>(&refCount)); }
+ int32_t count() { return refCount; }
+ private:
+ volatile int32_t refCount;
+-#elif defined(TAGLIB_ATOMIC_WIN)
++#elif defined(HAVE_WIN_ATOMIC)
+ void ref() { InterlockedIncrement(&refCount); }
+ bool deref() { return ! InterlockedDecrement(&refCount); }
+ long count() { return refCount; }
diff --git a/contrib/src/taglib/rules.mak b/contrib/src/taglib/rules.mak
index 055b6cf..d723665 100644
--- a/contrib/src/taglib/rules.mak
+++ b/contrib/src/taglib/rules.mak
@@ -17,6 +17,7 @@ taglib: taglib-$(TAGLIB_VERSION).tar.gz .sum-taglib
$(UNPACK)
$(APPLY) $(SRC)/taglib/taglib-pc.patch
$(APPLY) $(SRC)/taglib/0002-Rewrote-ByteVector-replace-simpler.patch
+ $(APPLY) $(SRC)/taglib/fix-atomic-checks.patch
$(MOVE)
.taglib: taglib toolchain.cmake
--
2.1.4
More information about the vlc-devel
mailing list