From 4c9c651a9ed0c6fd72ba6c6ca7b339b1aa1e1b07 Mon Sep 17 00:00:00 2001 From: Soham Roy Date: Wed, 13 Oct 2021 21:50:52 +0000 Subject: [PATCH] Replace naked pragmas with defines --- src/core/include/units/quantity_cast.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/include/units/quantity_cast.h b/src/core/include/units/quantity_cast.h index 1472b701..9c6d218a 100644 --- a/src/core/include/units/quantity_cast.h +++ b/src/core/include/units/quantity_cast.h @@ -29,9 +29,11 @@ #include #include +#define UNITS_PRAGMA(X) _Pragma(#X) #ifdef _MSC_VER -#pragma warning (push) -#pragma warning (disable:4244) // warning C4244: 'argument': conversion from 'intmax_t' to 'T', possible loss of data with T=int +#define UNITS_DIAGNOSTIC_PUSH UNITS_PRAGMA(warning(push)) +#define UNITS_DIAGNOSTIC_IGNORE_LOSSY_CONVERSION UNITS_PRAGMA(warning(disable : 4244)) +// warning C4244: 'argument': conversion from 'intmax_t' to 'T', possible loss of data with T=int #endif //_MSC_VER namespace units {