From af2f5f5500fe2762aa593df3d5c72832460763dd Mon Sep 17 00:00:00 2001 From: maveric2 <87258010+maveric2@users.noreply.github.com> Date: Thu, 16 Jan 2025 13:07:57 +0100 Subject: [PATCH] fix error: undefined symbol: sc_core::vcd_trace::compose_line() with SystemC 3.0.1 --- include/ac_sc.h | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/include/ac_sc.h b/include/ac_sc.h index 45b3db1..125a13b 100644 --- a/include/ac_sc.h +++ b/include/ac_sc.h @@ -430,17 +430,27 @@ class vcd_trace #else virtual void print_variable_declaration_line(FILE* f); #endif + +#if (SYSTEMC_VERSION < 20240329) // < SC-3.0.0 void compose_data_line(char* rawdata, char* compdata); +#else // >= SC-3.0.0 + void compose_data_line(char* rawdata, char* compdata, size_t compdata_n); +#endif -#if (SYSTEMC_VERSION >= 20140417) +#if (SYSTEMC_VERSION < 20241015) // < SC-3.0.1 + #if (SYSTEMC_VERSION >= 20140417) // >= SC-2.3.1 std::string compose_line(const std::string& data); -#else + #else std::string compose_line(const std::string data); + #endif +#else // >= SC-3.0.1 + void print_data_line(FILE* f, const char* rawdata); #endif - virtual ~vcd_trace(); + + virtual ~vcd_trace() = default; const std::string name; const std::string vcd_name; -#if (SYSTEMC_VERSION >= 20171012) +#if (SYSTEMC_VERSION >= 20171012) // >= SC-2.3.2 vcd_trace_file::vcd_enum vcd_var_type; #else const char* vcd_var_typ_name; @@ -476,7 +486,11 @@ class vcd_ac_int_trace : public sc_core::vcd_trace virtual void write(FILE* f) { // The function to_string(AC_BIN) returns a string with the zero-radix prefix (i.e. "0b"). // Strip that prefix off because compose_line will add its own. +#if (SYSTEMC_VERSION < 20241015) // < SC-3.0.1 std::fprintf(f, "%s", compose_line(((ac_int)object).to_string(AC_BIN,true).substr(3)).c_str()); +#else // >= SC-3.0.1 + print_data_line( f, ((ac_int)object).to_string(AC_BIN,true).substr(3).c_str() ); +#endif old_value = object; }