From b3e30392f7da04e02203a469848c0b23763e06ae Mon Sep 17 00:00:00 2001 From: Lukas W Date: Fri, 21 Nov 2014 11:47:02 +0100 Subject: [PATCH] Remove some legacy code for Qt<4.4 --- include/RemotePlugin.h | 10 ---- include/atomic_int.h | 103 ----------------------------------------- src/core/Mixer.cpp | 1 - 3 files changed, 114 deletions(-) delete mode 100644 include/atomic_int.h diff --git a/include/RemotePlugin.h b/include/RemotePlugin.h index 35a807079..000b37b87 100644 --- a/include/RemotePlugin.h +++ b/include/RemotePlugin.h @@ -53,12 +53,7 @@ #endif #include - -#if QT_VERSION >= 0x040400 #include -#else -#error building LMMS on this platform requires at least Qt 4.4.0 -#endif #else /* USE_QT_SEMAPHORES */ @@ -76,12 +71,7 @@ #ifdef USE_QT_SHMEM #include - -#if QT_VERSION >= 0x040400 #include -#else -#error building LMMS on this platform requires at least Qt 4.4.0 -#endif typedef int32_t key_t; diff --git a/include/atomic_int.h b/include/atomic_int.h deleted file mode 100644 index 168274ea2..000000000 --- a/include/atomic_int.h +++ /dev/null @@ -1,103 +0,0 @@ -/* - * atomic_int.h - fallback AtomicInt class when Qt is too old - * - * Copyright (c) 2009 Tobias Doerffel - * - * This file is part of LMMS - http://lmms.io - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program (see COPYING); if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301 USA. - * - */ - -#ifndef _ATOMIC_INT_H -#define _ATOMIC_INT_H - -#include - -#if QT_VERSION >= 0x040400 - -typedef QAtomicInt AtomicInt; - -#else -// implement our own (slow) QAtomicInt class when on old Qt -class AtomicInt -{ -public: - inline AtomicInt( int _value = 0 ) : - m_value( _value ), - m_lock() - { - } - - inline AtomicInt( const AtomicInt & _copy ) : - m_value( _copy.m_value ), - m_lock() - { - } - - inline int fetchAndStoreOrdered( int _newVal ) - { - m_lock.lock(); - const int oldVal = m_value; - m_value = _newVal; - m_lock.unlock(); - - return oldVal; - } - - inline int fetchAndAddOrdered( int _add ) - { - m_lock.lock(); - const int oldVal = m_value; - m_value += _add; - m_lock.unlock(); - - return oldVal; - } - - inline AtomicInt & operator=( const AtomicInt & _copy ) - { - m_lock.lock(); - m_value = _copy.m_value; - m_lock.unlock(); - - return *this; - } - - - inline AtomicInt & operator=( int _value ) - { - m_lock.lock(); - m_value = _value; - m_lock.unlock(); - - return *this; - } - - inline operator int() const - { - return m_value; - } - -private: - volatile int m_value; - QMutex m_lock; -} ; - -#endif - -#endif - diff --git a/src/core/Mixer.cpp b/src/core/Mixer.cpp index 3bc852260..8dc3932b5 100644 --- a/src/core/Mixer.cpp +++ b/src/core/Mixer.cpp @@ -38,7 +38,6 @@ #include "ConfigManager.h" #include "SamplePlayHandle.h" #include "PianoRoll.h" -#include "atomic_int.h" // platform-specific audio-interface-classes #include "AudioAlsa.h"