diff options
author | David Robillard <d@drobilla.net> | 2020-11-27 17:58:01 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-11-27 21:42:52 +0100 |
commit | 76e4307c2f57df359651dab61184fd521ffb1fbf (patch) | |
tree | c85f7aafeb55f6e6ee5074a856fb2cdda6019dc1 /src/warnings.hpp | |
parent | 7240920afeb38fb12f6c0cacb1661b82bf09c1fc (diff) | |
download | patchage-76e4307c2f57df359651dab61184fd521ffb1fbf.tar.gz patchage-76e4307c2f57df359651dab61184fd521ffb1fbf.tar.bz2 patchage-76e4307c2f57df359651dab61184fd521ffb1fbf.zip |
Fix unused parameter warnings
Diffstat (limited to 'src/warnings.hpp')
-rw-r--r-- | src/warnings.hpp | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/warnings.hpp b/src/warnings.hpp new file mode 100644 index 0000000..14dbbe0 --- /dev/null +++ b/src/warnings.hpp @@ -0,0 +1,43 @@ +/* This file is part of Patchage. + * Copyright 2020 David Robillard <d@drobilla.net> + * + * Patchage 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. + * + * Patchage 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 details. + * + * You should have received a copy of the GNU General Public License + * along with Patchage. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef PATCHAGE_WARNINGS_HPP +#define PATCHAGE_WARNINGS_HPP + +#if defined(__clang__) + +# define PATCHAGE_DISABLE_GANV_WARNINGS \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Wunused-parameter\"") + +# define PATCHAGE_RESTORE_WARNINGS _Pragma("clang diagnostic pop") + +#elif defined(__GNUC__) + +# define PATCHAGE_DISABLE_GANV_WARNINGS \ + _Pragma("GCC diagnostic push") \ + _Pragma("GCC diagnostic ignored \"-Wunused-parameter\"") + +# define PATCHAGE_RESTORE_WARNINGS _Pragma("GCC diagnostic pop") + +#else + +# define PATCHAGE_DISABLE_GANV_WARNINGS +# define PATCHAGE_RESTORE_WARNINGS + +#endif + +#endif // PATCHAGE_WARNINGS_HPP |