diff --git a/vpi/libvpi.c b/vpi/libvpi.c index 198653112..e86375ec1 100644 --- a/vpi/libvpi.c +++ b/vpi/libvpi.c @@ -17,6 +17,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#if defined(__MINGW32__) || defined (__CYGWIN32__) + #include "vpi_user.h" vpip_routines_s*vpip_routines = 0; @@ -25,3 +27,11 @@ DLLEXPORT void vpip_set_callback(vpip_routines_s*routines) { vpip_routines = routines; } + +#else + +void __libvpi_c_dummy_function(void) +{ +} + +#endif diff --git a/vpi_modules.cc b/vpi_modules.cc index 7dca89ab0..b6a5f8e4a 100644 --- a/vpi_modules.cc +++ b/vpi_modules.cc @@ -184,6 +184,7 @@ vpiHandle vpi_register_systf(const struct t_vpi_systf_data*ss) return 0; } +#if defined(__MINGW32__) || defined (__CYGWIN32__) vpip_routines_s vpi_routines = { .register_cb = vpi_register_cb, .remove_cb = vpi_remove_cb, @@ -229,6 +230,7 @@ vpip_routines_s vpi_routines = { }; typedef void (*vpip_set_callback_t)(vpip_routines_s*); +#endif typedef void (*vlog_startup_routines_t)(void); bool load_vpi_module(const char*path) @@ -240,6 +242,7 @@ bool load_vpi_module(const char*path) return false; } +#if defined(__MINGW32__) || defined (__CYGWIN32__) void*function = ivl_dlsym(dll, "vpip_set_callback"); if (function == 0) { cerr << "warning: '" << path << "' has no vpip_set_callback()" << endl; @@ -248,6 +251,7 @@ bool load_vpi_module(const char*path) } vpip_set_callback_t set_callback = (vpip_set_callback_t)function; set_callback(&vpi_routines); +#endif void*table = ivl_dlsym(dll, LU "vlog_startup_routines" TU); if (table == 0) { diff --git a/vpi_user.h b/vpi_user.h index 7cc30c922..65a7500e2 100644 --- a/vpi_user.h +++ b/vpi_user.h @@ -675,6 +675,7 @@ extern void vpip_count_drivers(vpiHandle ref, unsigned idx, # define _vpi_at_APV 6 #endif +#if defined(__MINGW32__) || defined (__CYGWIN32__) /* * In Linux, when loaded, a shared library can automatically bind to functions * provided by its client. In Windows, a DLL can only do this statically at @@ -780,6 +781,8 @@ extern vpip_routines_s*vpip_routines; #endif // IVL_VPI_MODULE +#endif // defined(__MINGW32__) || defined (__CYGWIN32__) + EXTERN_C_END #endif /* VPI_USER_H */ diff --git a/vvp/vpi_modules.cc b/vvp/vpi_modules.cc index 1e8ffe945..ac2450944 100644 --- a/vvp/vpi_modules.cc +++ b/vvp/vpi_modules.cc @@ -30,7 +30,9 @@ static ivl_dll_t*dll_list = 0; static unsigned dll_list_cnt = 0; +#if defined(__MINGW32__) || defined (__CYGWIN32__) typedef void (*vpip_set_callback_t)(vpip_routines_s*); +#endif typedef void (*vlog_startup_routines_t)(void); # define VPIP_MODULE_PATH_MAX 64 @@ -216,6 +218,7 @@ void vpip_load_module(const char*name) return; } +#if defined(__MINGW32__) || defined (__CYGWIN32__) void*function = ivl_dlsym(dll, "vpip_set_callback"); if (function == 0) { fprintf(stderr, "%s: no vpip_set_callback()\n", name); @@ -224,6 +227,7 @@ void vpip_load_module(const char*name) } vpip_set_callback_t set_callback = (vpip_set_callback_t)function; set_callback(&vpi_routines); +#endif void*table = ivl_dlsym(dll, LU "vlog_startup_routines" TU); if (table == 0) { diff --git a/vvp/vpi_priv.cc b/vvp/vpi_priv.cc index ba9476f9a..f23a7b7fe 100644 --- a/vvp/vpi_priv.cc +++ b/vvp/vpi_priv.cc @@ -1635,6 +1635,7 @@ extern "C" void vpip_count_drivers(vpiHandle ref, unsigned idx, rfp->node->count_drivers(idx, counts); } +#if defined(__MINGW32__) || defined (__CYGWIN32__) vpip_routines_s vpi_routines = { .register_cb = vpi_register_cb, .remove_cb = vpi_remove_cb, @@ -1678,3 +1679,4 @@ vpip_routines_s vpi_routines = { .mcd_rawwrite = vpip_mcd_rawwrite, .set_return_value = vpip_set_return_value, }; +#endif diff --git a/vvp/vpi_priv.h b/vvp/vpi_priv.h index d183135e5..213126183 100644 --- a/vvp/vpi_priv.h +++ b/vvp/vpi_priv.h @@ -48,7 +48,9 @@ typedef struct __vpiArray* vvp_array_t; * header file elsewhere. */ +#if defined(__MINGW32__) || defined (__CYGWIN32__) extern vpip_routines_s vpi_routines; +#endif /* * Routines/definitions used to build the file/line number tracing object.