29 #define TAGLIB_MAJOR_VERSION 1
30 #define TAGLIB_MINOR_VERSION 8
31 #define TAGLIB_PATCH_VERSION 0
33 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 1))
34 #define TAGLIB_IGNORE_MISSING_DESTRUCTOR _Pragma("GCC diagnostic ignored \"-Wnon-virtual-dtor\"")
36 #define TAGLIB_IGNORE_MISSING_DESTRUCTOR
39 #if (defined(_MSC_VER) && _MSC_VER >= 1600)
40 #define TAGLIB_CONSTRUCT_BITSET(x) static_cast<unsigned long long>(x)
42 #define TAGLIB_CONSTRUCT_BITSET(x) static_cast<unsigned long>(x)
48 # include <libkern/OSAtomic.h>
49 # define TAGLIB_ATOMIC_MAC
50 #elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
51 # if !defined(NOMINMAX)
55 # define TAGLIB_ATOMIC_WIN
56 #elif defined (__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 401) \
57 && (defined(__i386__) || defined(__i486__) || defined(__i586__) || \
58 defined(__i686__) || defined(__x86_64) || defined(__ia64)) \
59 && !defined(__INTEL_COMPILER)
60 # define TAGLIB_ATOMIC_GCC
61 #elif defined(__ia64) && defined(__INTEL_COMPILER)
62 # include <ia64intrin.h>
63 # define TAGLIB_ATOMIC_GCC
80 typedef wchar_t wchar;
92 #ifndef DO_NOT_DOCUMENT // Tell Doxygen to skip this class.
103 RefCounter() : refCount(1) {}
105 #ifdef TAGLIB_ATOMIC_MAC
106 void ref() { OSAtomicIncrement32Barrier(const_cast<int32_t*>(&refCount)); }
107 bool deref() {
return ! OSAtomicDecrement32Barrier(const_cast<int32_t*>(&refCount)); }
108 int32_t count() {
return refCount; }
110 volatile int32_t refCount;
111 #elif defined(TAGLIB_ATOMIC_WIN)
112 void ref() { InterlockedIncrement(&refCount); }
113 bool deref() {
return ! InterlockedDecrement(&refCount); }
114 long count() {
return refCount; }
116 volatile long refCount;
117 #elif defined(TAGLIB_ATOMIC_GCC)
118 void ref() { __sync_add_and_fetch(&refCount, 1); }
119 bool deref() {
return ! __sync_sub_and_fetch(&refCount, 1); }
120 int count() {
return refCount; }
122 volatile int refCount;
124 void ref() { refCount++; }
125 bool deref() {
return ! --refCount; }
126 int count() {
return refCount; }
133 #endif // DO_NOT_DOCUMENT