From d4038a50832d5c3a81ee55b4683776720fed1c7d Mon Sep 17 00:00:00 2001 From: Jerome Haxhiaj Date: Wed, 27 Aug 2025 14:11:59 +0200 Subject: [PATCH] sc_signed: Use auto type on save/restore old flags This patch removes conditional type for os.setf(), which was failing on msys2 llvm environment and replaces it by auto type. Signed-off-by: Jerome Haxhiaj --- src/sysc/datatypes/int/sc_signed.cpp | 6 +----- src/sysc/datatypes/int/sc_unsigned.cpp | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/sysc/datatypes/int/sc_signed.cpp b/src/sysc/datatypes/int/sc_signed.cpp index dc3cdb679..229ddefcf 100644 --- a/src/sysc/datatypes/int/sc_signed.cpp +++ b/src/sysc/datatypes/int/sc_signed.cpp @@ -575,11 +575,7 @@ void sc_signed::dump(::std::ostream& os) const { // Save the current setting, and set the base to decimal. -#if defined(__MINGW32__) - std::_Ios_Fmtflags old_flags = os.setf(::std::ios::dec,::std::ios::basefield); -#else - fmtflags old_flags = os.setf(::std::ios::dec, ::std::ios::basefield); -#endif + auto old_flags = os.setf(::std::ios::dec, ::std::ios::basefield); os << "width = " << length() << ::std::endl; os << "value = " << *this << ::std::endl; diff --git a/src/sysc/datatypes/int/sc_unsigned.cpp b/src/sysc/datatypes/int/sc_unsigned.cpp index b366922ca..08ee64525 100644 --- a/src/sysc/datatypes/int/sc_unsigned.cpp +++ b/src/sysc/datatypes/int/sc_unsigned.cpp @@ -554,11 +554,7 @@ void sc_unsigned::dump(::std::ostream& os) const { // Save the current setting, and set the base to decimal. -#if defined(__MINGW32__) - std::_Ios_Fmtflags old_flags = os.setf(::std::ios::dec,::std::ios::basefield); -#else - fmtflags old_flags = os.setf(::std::ios::dec, ::std::ios::basefield); -#endif + auto old_flags = os.setf(::std::ios::dec, ::std::ios::basefield); os << "width = " << length() << ::std::endl; os << "value = " << *this << ::std::endl;