29 #define TAGLIB_MAJOR_VERSION 1
30 #define TAGLIB_MINOR_VERSION 7
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__)
53 # define TAGLIB_ATOMIC_WIN
54 #elif defined (__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 401) \
55 && (defined(__i386__) || defined(__i486__) || defined(__i586__) || \
56 defined(__i686__) || defined(__x86_64) || defined(__ia64)) \
57 && !defined(__INTEL_COMPILER)
58 # define TAGLIB_ATOMIC_GCC
59 #elif defined(__ia64) && defined(__INTEL_COMPILER)
60 # include <ia64intrin.h>
61 # define TAGLIB_ATOMIC_GCC
78 typedef wchar_t wchar;
90 #ifndef DO_NOT_DOCUMENT // Tell Doxygen to skip this class.
101 RefCounter() : refCount(1) {}
103 #ifdef TAGLIB_ATOMIC_MAC
104 void ref() { OSAtomicIncrement32Barrier(const_cast<int32_t*>(&refCount)); }
105 bool deref() {
return ! OSAtomicDecrement32Barrier(const_cast<int32_t*>(&refCount)); }
106 int32_t count() {
return refCount; }
108 volatile int32_t refCount;
109 #elif defined(TAGLIB_ATOMIC_WIN)
110 void ref() { InterlockedIncrement(&refCount); }
111 bool deref() {
return ! InterlockedDecrement(&refCount); }
112 long count() {
return refCount; }
114 volatile long refCount;
115 #elif defined(TAGLIB_ATOMIC_GCC)
116 void ref() { __sync_add_and_fetch(&refCount, 1); }
117 bool deref() {
return ! __sync_sub_and_fetch(&refCount, 1); }
118 int count() {
return refCount; }
120 volatile int refCount;
122 void ref() { refCount++; }
123 bool deref() {
return ! --refCount; }
124 int count() {
return refCount; }
131 #endif // DO_NOT_DOCUMENT