From 22e8153d96663f013d7c43b1d1807d5799ab411d Mon Sep 17 00:00:00 2001 From: Michael Kuron <mkuron@icp.uni-stuttgart.de> Date: Mon, 5 Oct 2020 11:20:15 +0200 Subject: [PATCH] Switch to C++14 deprecation warnings Our own wrappers was only used in one place anyway and did not all allow for specify a reason string. --- src/core/Deprecated.h | 50 ------------------------------ src/core/all.h | 1 - src/pe/fcd/SimpleFCDDataHandling.h | 5 ++- 3 files changed, 2 insertions(+), 54 deletions(-) delete mode 100644 src/core/Deprecated.h diff --git a/src/core/Deprecated.h b/src/core/Deprecated.h deleted file mode 100644 index 8e9fb843a..000000000 --- a/src/core/Deprecated.h +++ /dev/null @@ -1,50 +0,0 @@ -//====================================================================================================================== -// -// This file is part of waLBerla. waLBerla 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 3 of -// the License, or (at your option) any later version. -// -// waLBerla 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 waLBerla (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. -// -//! \file Deprecated.h -//! \ingroup core -//! \author Christian Godenschwager <christian.godenschwager@fau.de> -// -//====================================================================================================================== - -#pragma once - - - -/*******************************************************************************************************************//** - * \brief Macro to mark a function as deprecated - * - * To mark a function as deprecated wrap its signature with the WALBERLA_DEPRECATED macro at the definition. - * E.g. to mark int f(const & foo) const; as deprecated use WALBERLA_DEPRECATED(int f(const & foo) const); - * Note that this won't work for functions with a comma in their return type definition! E.g. to mark - * std::pair<int,int> f(); as deprecated add a typedef std::pair<int, int> PairInt; first an then deprecate - * via WALBERLA_DEPRECATE(PairInt f()); - * Deprecation of a function will produce a compiler warning if the function is used despite it's deprecation. - * - * \param func The function to be marked deprecated. - **********************************************************************************************************************/ - -#ifdef __GNUC__ -# define WALBERLA_DEPRECATED(func) func __attribute__ ((deprecated)) -#elif defined(_MSC_VER) -# define WALBERLA_DEPRECATED(func) __declspec(deprecated) func -#elif defined(__IBMCPP__) -# define WALBERLA_DEPRECATED(func) func // xlc++ (12.1) has no obvious possibility for deprecation -#elif defined(_SX) -# define WALBERLA_DEPRECATED(func) __declspec(deprecated) func -#else -# pragma message("WARNING: You need to implement WALBERLA_DEPRECATED for this compiler!") -# define WALBERLA_DEPRECATED(func) func -#endif diff --git a/src/core/all.h b/src/core/all.h index e15f23d38..2e804b55a 100644 --- a/src/core/all.h +++ b/src/core/all.h @@ -26,7 +26,6 @@ #include "AllSet.h" #include "Array.h" #include "DataTypes.h" -#include "Deprecated.h" #include "EndianIndependentSerialization.h" #include "Environment.h" #include "FunctionTraits.h" diff --git a/src/pe/fcd/SimpleFCDDataHandling.h b/src/pe/fcd/SimpleFCDDataHandling.h index 1fce240e0..ae787ffe5 100644 --- a/src/pe/fcd/SimpleFCDDataHandling.h +++ b/src/pe/fcd/SimpleFCDDataHandling.h @@ -23,7 +23,6 @@ #include "SimpleFCD.h" #include "blockforest/BlockDataHandling.h" -#include "core/Deprecated.h" namespace walberla{ namespace pe{ @@ -35,9 +34,9 @@ public: SimpleFCD<BodyTypeTuple> * initialize( IBlock * const /*block*/ ) {return new SimpleFCD<BodyTypeTuple>();} }; -/// \attention This function is deprecated. Use createGenericFCDDataHandling<BodyTypeTuple, AnalyticCollideFunctor>() instead! +[[deprecated("Use createGenericFCDDataHandling<BodyTypeTuple, AnalyticCollideFunctor>() instead")]] template <typename BodyTypeTuple> -WALBERLA_DEPRECATED(shared_ptr<SimpleFCDDataHandling<BodyTypeTuple> > createSimpleFCDDataHandling()); +shared_ptr<SimpleFCDDataHandling<BodyTypeTuple> > createSimpleFCDDataHandling(); template <typename BodyTypeTuple> shared_ptr<SimpleFCDDataHandling<BodyTypeTuple> > createSimpleFCDDataHandling() -- GitLab