From b53dc0a14af2e47e97ee21e984420054a5b2b15f Mon Sep 17 00:00:00 2001 From: lisyarus Date: Mon, 18 Jan 2021 18:18:10 +0300 Subject: [PATCH] Fix compiler-specific diagnostic in painter.cpp --- libs/gfx/source/painter.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/libs/gfx/source/painter.cpp b/libs/gfx/source/painter.cpp index c890acc8..6e518566 100644 --- a/libs/gfx/source/painter.cpp +++ b/libs/gfx/source/painter.cpp @@ -490,11 +490,22 @@ namespace psemek::gfx for (char c : str) { // Guard against unsigned char +#ifdef __GNUC__ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wtype-limits" -#pragma GCC diagnostic ignored "-Wtautological-constant-out-of-range-compare" +#endif +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-constant-out-of-range-compare" +#endif + if ((c < 32) || (c >= 128)) c = '?'; +#ifdef __GNUC__ #pragma GCC diagnostic pop +#endif +#ifdef __clang__ +#pragma clang diagnostic pop +#endif int ty = (c - 32) / 16; int tx = (c - 32) % 16;