From da31486cb6dd20b0ae64ab4c6c68087128f8be77 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sat, 26 Jul 2025 14:05:01 +0200 Subject: [PATCH] Remove CarlaPluginPtr.hpp compat file Signed-off-by: falkTX --- source/backend/CarlaEngine.hpp | 4 +- source/backend/CarlaPlugin.hpp | 8 +- source/backend/CarlaPluginPtr.hpp | 273 ----------------------- source/backend/engine/CarlaEngineOsc.hpp | 20 +- 4 files changed, 11 insertions(+), 294 deletions(-) delete mode 100644 source/backend/CarlaPluginPtr.hpp diff --git a/source/backend/CarlaEngine.hpp b/source/backend/CarlaEngine.hpp index 2b6e0b631..0ebd5ffbb 100644 --- a/source/backend/CarlaEngine.hpp +++ b/source/backend/CarlaEngine.hpp @@ -1,11 +1,11 @@ -// SPDX-FileCopyrightText: 2011-2024 Filipe Coelho +// SPDX-FileCopyrightText: 2011-2025 Filipe Coelho // SPDX-License-Identifier: GPL-2.0-or-later #ifndef CARLA_ENGINE_HPP_INCLUDED #define CARLA_ENGINE_HPP_INCLUDED #include "CarlaBackend.h" -#include "CarlaPluginPtr.hpp" +#include "CarlaPlugin.hpp" namespace water { class MemoryOutputStream; diff --git a/source/backend/CarlaPlugin.hpp b/source/backend/CarlaPlugin.hpp index 3dc5e0d1a..5ae7f50f7 100644 --- a/source/backend/CarlaPlugin.hpp +++ b/source/backend/CarlaPlugin.hpp @@ -1,11 +1,12 @@ -// SPDX-FileCopyrightText: 2011-2024 Filipe Coelho +// SPDX-FileCopyrightText: 2011-2025 Filipe Coelho // SPDX-License-Identifier: GPL-2.0-or-later #ifndef CARLA_PLUGIN_HPP_INCLUDED #define CARLA_PLUGIN_HPP_INCLUDED #include "CarlaBackend.h" -#include "CarlaPluginPtr.hpp" + +#include // ----------------------------------------------------------------------- // Avoid including extra libs here @@ -37,9 +38,12 @@ class CarlaEngineCVPort; class CarlaEngineEventPort; class CarlaEngineCVSourcePorts; class CarlaEngineBridge; +class CarlaPlugin; struct CarlaStateSave; struct EngineEvent; +typedef std::shared_ptr CarlaPluginPtr; + // ----------------------------------------------------------------------- /*! diff --git a/source/backend/CarlaPluginPtr.hpp b/source/backend/CarlaPluginPtr.hpp deleted file mode 100644 index c69f3cc98..000000000 --- a/source/backend/CarlaPluginPtr.hpp +++ /dev/null @@ -1,273 +0,0 @@ -/* - * Carla Plugin Host - * Copyright (C) 2011-2020 Filipe Coelho - * - * 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 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. - * - * For a full copy of the GNU General Public License see the doc/GPL.txt file. - */ - -#ifndef CARLA_CPP_COMPAT_HPP_INCLUDED -#define CARLA_CPP_COMPAT_HPP_INCLUDED - -#include "CarlaDefines.h" - -#ifdef CARLA_PROPER_CPP11_SUPPORT -# include -#else -# include -# include "CarlaUtils.hpp" -#endif - -// ----------------------------------------------------------------------- - -#ifndef CARLA_PROPER_CPP11_SUPPORT -namespace std { - -/* This code is part of shared_ptr.hpp: - * minimal implementation of smart pointer, a subset of the C++11 std::shared_ptr or boost::shared_ptr. - * Copyright (c) 2013-2019 Sebastien Rombauts (sebastien.rombauts@gmail.com) - * Distributed under the MIT License (MIT) - */ -class shared_ptr_count -{ -public: - shared_ptr_count() : pn(nullptr) {} - shared_ptr_count(const shared_ptr_count& count) : pn(count.pn) {} - void swap(shared_ptr_count& lhs) noexcept { std::swap(pn, lhs.pn); } - - long use_count(void) const noexcept - { - long count = 0; - if (nullptr != pn) - { - count = *pn; - } - return count; - } - - template - void acquire(U* p) - { - if (nullptr != p) - { - if (nullptr == pn) - { - try - { - pn = new volatile long(1); - } - catch (std::bad_alloc&) - { - delete p; - throw; - } - } - else - { - ++(*pn); - } - } - } - - template - void release(U* p) noexcept - { - if (nullptr != pn) - { - --(*pn); - if (0 == *pn) - { - delete p; - delete pn; - } - pn = nullptr; - } - } - -public: - volatile long* pn; -}; - -template -class shared_ptr -{ -public: - typedef T element_type; - - shared_ptr(void) noexcept - : px(nullptr), - pn() {} - - /*explicit*/ shared_ptr(T* p) - : px(nullptr), - pn() - { - acquire(p); - } - - template - shared_ptr(const shared_ptr& ptr, T* p) : - px(nullptr), - pn(ptr.pn) - { - acquire(p); - } - - template - shared_ptr(const shared_ptr& ptr) noexcept : - px(nullptr), - pn(ptr.pn) - { - CARLA_SAFE_ASSERT_RETURN(nullptr == ptr.px || 0 != ptr.pn.use_count(),); - acquire(static_cast::element_type*>(ptr.px)); - } - - shared_ptr(const shared_ptr& ptr) noexcept : - px(nullptr), - pn(ptr.pn) - { - CARLA_SAFE_ASSERT_RETURN(nullptr == ptr.px || 0 != ptr.pn.use_count(),); - acquire(ptr.px); - } - - shared_ptr& operator=(shared_ptr ptr) noexcept - { - swap(ptr); - return *this; - } - - ~shared_ptr(void) noexcept - { - release(); - } - - void reset(void) noexcept - { - release(); - } - - void swap(shared_ptr& lhs) noexcept - { - std::swap(px, lhs.px); - pn.swap(lhs.pn); - } - - operator bool() const noexcept - { - return (0 < pn.use_count()); - } - long use_count(void) const noexcept - { - return pn.use_count(); - } - - // underlying pointer operations : - T& operator*() const noexcept - { - return *px; - } - T* operator->() const noexcept - { - return px; - } - T* get(void) const noexcept - { - return px; - } - -private: - void acquire(T* p) - { - pn.acquire(p); - px = p; - } - - void release(void) noexcept - { - pn.release(px); - px = nullptr; - } - -private: - template - friend class shared_ptr; - -private: - T* px; - shared_ptr_count pn; -}; - -template bool operator==(const shared_ptr& l, const shared_ptr& r) noexcept -{ - return (l.get() == r.get()); -} -template bool operator!=(const shared_ptr& l, const shared_ptr& r) noexcept -{ - return (l.get() != r.get()); -} -template bool operator<=(const shared_ptr& l, const shared_ptr& r) noexcept -{ - return (l.get() <= r.get()); -} -template bool operator<(const shared_ptr& l, const shared_ptr& r) noexcept -{ - return (l.get() < r.get()); -} -template bool operator>=(const shared_ptr& l, const shared_ptr& r) noexcept -{ - return (l.get() >= r.get()); -} -template bool operator>(const shared_ptr& l, const shared_ptr& r) noexcept -{ - return (l.get() > r.get()); -} -template -shared_ptr static_pointer_cast(const shared_ptr& ptr) -{ - return shared_ptr(ptr, static_cast::element_type*>(ptr.get())); -} -template -shared_ptr dynamic_pointer_cast(const shared_ptr& ptr) -{ - T* p = dynamic_cast::element_type*>(ptr.get()); - if (nullptr != p) - { - return shared_ptr(ptr, p); - } - else - { - return shared_ptr(); - } -} -template -bool operator==(const shared_ptr& pointer1, T* const pointer2) noexcept -{ - return static_cast(pointer1) == pointer2; -} -template -bool operator!=(const shared_ptr& pointer1, T* const pointer2) noexcept -{ - return static_cast(pointer1) != pointer2; -} - -} // namespace std -#endif // CARLA_PROPER_CPP11_SUPPORT - -CARLA_BACKEND_START_NAMESPACE - -typedef std::shared_ptr CarlaPluginPtr; - -CARLA_BACKEND_END_NAMESPACE - -// ----------------------------------------------------------------------- - -#endif // CARLA_CPP_COMPAT_HPP_INCLUDED diff --git a/source/backend/engine/CarlaEngineOsc.hpp b/source/backend/engine/CarlaEngineOsc.hpp index a4a102877..be2fca55e 100644 --- a/source/backend/engine/CarlaEngineOsc.hpp +++ b/source/backend/engine/CarlaEngineOsc.hpp @@ -1,19 +1,5 @@ -/* - * Carla Plugin Host - * Copyright (C) 2011-2020 Filipe Coelho - * - * 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 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. - * - * For a full copy of the GNU General Public License see the doc/GPL.txt file. - */ +// SPDX-FileCopyrightText: 2011-2025 Filipe Coelho +// SPDX-License-Identifier: GPL-2.0-or-later #ifndef CARLA_ENGINE_OSC_HPP_INCLUDED #define CARLA_ENGINE_OSC_HPP_INCLUDED @@ -24,7 +10,7 @@ #include "CarlaBackend.h" #include "CarlaJuceUtils.hpp" -#include "CarlaPluginPtr.hpp" +#include "CarlaPlugin.hpp" #include "CarlaOscUtils.hpp" #include "CarlaString.hpp"