Add correct C++ cast for the vpi_modules

This commit is contained in:
Cary R 2025-10-21 00:43:36 -07:00
parent b7292e0179
commit 702189a948
2 changed files with 2 additions and 2 deletions

View File

@ -253,7 +253,7 @@ bool load_vpi_module(const char*path)
ivl_dlclose(dll); ivl_dlclose(dll);
return true; return true;
} }
vpip_set_callback_t set_callback = (vpip_set_callback_t)function; vpip_set_callback_t set_callback = reinterpret_cast<vpip_set_callback_t>(function);
if (!set_callback(&vpi_routines, vpip_routines_version)) { if (!set_callback(&vpi_routines, vpip_routines_version)) {
cerr << "error: Failed to link '" << path << "'. " cerr << "error: Failed to link '" << path << "'. "
"Try rebuilding it with iverilog-vpi." << endl; "Try rebuilding it with iverilog-vpi." << endl;

View File

@ -232,7 +232,7 @@ void vpip_load_module(const char*name)
#if defined(__MINGW32__) || defined (__CYGWIN__) #if defined(__MINGW32__) || defined (__CYGWIN__)
void*function = ivl_dlsym(dll, "vpip_set_callback"); void*function = ivl_dlsym(dll, "vpip_set_callback");
if (function) { if (function) {
vpip_set_callback_t set_callback = (vpip_set_callback_t)function; vpip_set_callback_t set_callback = reinterpret_cast<vpip_set_callback_t>(function);
if (!set_callback(&vpi_routines, vpip_routines_version)) { if (!set_callback(&vpi_routines, vpip_routines_version)) {
fprintf(stderr, "Failed to link VPI module %s. Try rebuilding it with iverilog-vpi.\n", name); fprintf(stderr, "Failed to link VPI module %s. Try rebuilding it with iverilog-vpi.\n", name);
ivl_dlclose(dll); ivl_dlclose(dll);