From c39260ff4e4d59377c41a36978b47e8cbdb6253c Mon Sep 17 00:00:00 2001 From: Billy O'Neal Date: Sat, 16 May 2026 01:59:43 -0700 Subject: [PATCH] [systemc] Remove non-standard iostreams opfx/osfx. (#51814) --- ports/systemc/msvc-opfx-removal.diff | 35 ++++++++++++++++++++++++++++ ports/systemc/portfile.cmake | 1 + ports/systemc/vcpkg.json | 1 + versions/baseline.json | 2 +- versions/s-/systemc.json | 5 ++++ 5 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 ports/systemc/msvc-opfx-removal.diff diff --git a/ports/systemc/msvc-opfx-removal.diff b/ports/systemc/msvc-opfx-removal.diff new file mode 100644 index 0000000000..36b2c9e202 --- /dev/null +++ b/ports/systemc/msvc-opfx-removal.diff @@ -0,0 +1,35 @@ +diff --git a/src/sysc/datatypes/int/sc_int64_io.cpp b/src/sysc/datatypes/int/sc_int64_io.cpp +index 92148f477..f97b03135 100644 +--- a/src/sysc/datatypes/int/sc_int64_io.cpp ++++ b/src/sysc/datatypes/int/sc_int64_io.cpp +@@ -151,17 +151,17 @@ write_uint64(::std::ostream& os, uint64 val, int sign) + goto fail; + } + } +- os.osfx(); + return; + fail: + //os.set(::std::ios::badbit); +- os.osfx(); ++ return; + } + + ::std::ostream& + operator << ( ::std::ostream& os, int64 n ) + { +- if (os.opfx()) { ++ ::std::ostream::sentry sentry(os); ++ if (sentry) { + int sign = 1; + uint64 abs_n = (uint64) n; + if (n < 0 && (os.flags() & (::std::ios::oct|::std::ios::hex)) == 0) { +@@ -176,7 +176,8 @@ operator << ( ::std::ostream& os, int64 n ) + ::std::ostream& + operator << ( ::std::ostream& os, uint64 n ) + { +- if (os.opfx()) { ++ ::std::ostream::sentry sentry(os); ++ if (sentry) { + sc_dt::write_uint64(os, n, 0); + } + return os; diff --git a/ports/systemc/portfile.cmake b/ports/systemc/portfile.cmake index 91c842f4cc..63eefdc6b9 100644 --- a/ports/systemc/portfile.cmake +++ b/ports/systemc/portfile.cmake @@ -8,6 +8,7 @@ vcpkg_from_github( HEAD_REF main PATCHES install.patch + msvc-opfx-removal.diff # https://github.com/accellera-official/systemc/pull/159 ) vcpkg_cmake_configure( diff --git a/ports/systemc/vcpkg.json b/ports/systemc/vcpkg.json index de662c5f89..157f37cefb 100644 --- a/ports/systemc/vcpkg.json +++ b/ports/systemc/vcpkg.json @@ -1,6 +1,7 @@ { "name": "systemc", "version": "3.0.2", + "port-version": 1, "description": "A set of C++ classes and macros which provide an event-driven simulation kernel in C++", "homepage": "https://systemc.org/overview/systemc/", "dependencies": [ diff --git a/versions/baseline.json b/versions/baseline.json index 3db7f3b65e..28eb5d19ba 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -9878,7 +9878,7 @@ }, "systemc": { "baseline": "3.0.2", - "port-version": 0 + "port-version": 1 }, "tabulate": { "baseline": "1.5", diff --git a/versions/s-/systemc.json b/versions/s-/systemc.json index 26cc369b8a..c4bab2a73f 100644 --- a/versions/s-/systemc.json +++ b/versions/s-/systemc.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "a72f96fe4aa97c377c361f4ec5f0c536ff471afe", + "version": "3.0.2", + "port-version": 1 + }, { "git-tree": "57a72011666c4db8e2108a39d2f4aefe9865d43b", "version": "3.0.2",