diff options
author | Hannah von Reth <hannah.vonreth@owncloud.com> | 2021-06-23 11:48:24 +0300 |
---|---|---|
committer | Hannah von Reth <vonreth@kde.org> | 2021-06-24 13:51:07 +0300 |
commit | 8fd1487d52c218344c654501d695afaff65f747c (patch) | |
tree | 6eb3126162556cc1f58d1202b168180aaf36e1dc /src/common | |
parent | 02f17c738c66a0d00c2bd5dd2418ffa67e5ee75b (diff) |
Add macro to temporarily disable depreaction
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/depreaction.h | 30 |
1 files changed, 30 insertions, 0 deletions
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 <hannah.vonreth@owncloud.com> + * + * 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 <qglobal.h> + +#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 |