From 8fd1487d52c218344c654501d695afaff65f747c Mon Sep 17 00:00:00 2001 From: Hannah von Reth Date: Wed, 23 Jun 2021 10:48:24 +0200 Subject: Add macro to temporarily disable depreaction --- src/common/depreaction.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/common/depreaction.h (limited to 'src/common') diff --git a/src/common/depreaction.h b/src/common/depreaction.h new file mode 100644 index 000000000..0b741a071 --- /dev/null +++ b/src/common/depreaction.h @@ -0,0 +1,30 @@ +/* + * Copyright (C) by Hannah von Reth + * + * 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. + */ +#pragma once +#include + +#ifdef Q_CC_MSVC +// _Pragma would require C99 ecm currently sets C90 +#define OC_DISABLE_DEPRECATED_WARNING \ + __pragma(warning(push)); \ + __pragma(warning(disable : 4996)) + +#define OC_ENABLE_DEPRECATED_WARNING __pragma(warning(pop)) +#else +#define OC_DISABLE_DEPRECATED_WARNING \ + _Pragma("GCC diagnostic push"); \ + _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") + +#define OC_ENABLE_DEPRECATED_WARNING _Pragma("GCC diagnostic pop") +#endif -- cgit v1.2.3