diff options
Diffstat (limited to 'benchmark/warnings.h')
-rw-r--r-- | benchmark/warnings.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/benchmark/warnings.h b/benchmark/warnings.h new file mode 100644 index 0000000..cb3a618 --- /dev/null +++ b/benchmark/warnings.h @@ -0,0 +1,42 @@ +/* + Copyright 2020 David Robillard <d@drobilla.net> + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ + +#ifndef WARNINGS_H +#define WARNINGS_H + +#if defined(__clang__) + +# define ZIX_DISABLE_GLIB_WARNINGS \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Wdocumentation-unknown-command\"") \ + _Pragma("clang diagnostic ignored \"-Wdocumentation\"") + +# define ZIX_RESTORE_WARNINGS _Pragma("clang diagnostic pop") + +#elif defined(__GNUC__) + +# define ZIX_DISABLE_GLIB_WARNINGS _Pragma("GCC diagnostic push") + +# define ZIX_RESTORE_WARNINGS _Pragma("GCC diagnostic pop") + +#else + +# define ZIX_DISABLE_GLIB_WARNINGS +# define ZIX_RESTORE_WARNINGS + +#endif + +#endif // WARNINGS_H |