From cf44f05cd39af962acaf5c5dcdeae714baf072f4 Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Sun, 10 May 2020 14:06:53 +0100 Subject: [PATCH] Fix GitHub issue #324 - replace __CYGWIN32__ with __CYGWIN__. __CYGWIN32__ is not defined when building with the 64-bit Cygwin toolchain. According to the Cygwin FAQ, __CYGWIN__ has been defined since 1998, so this should still work for users on 32-bit systems. --- ivl_target.h | 2 +- main.cc | 2 +- sv_vpi_user.h | 2 +- veriuser.h | 2 +- vpi/libvpi.c | 2 +- vpi_modules.cc | 4 ++-- vpi_user.h | 6 +++--- vvp/vpi_modules.cc | 4 ++-- vvp/vpi_priv.cc | 2 +- vvp/vpi_priv.h | 2 +- 10 files changed, 14 insertions(+), 14 deletions(-) diff --git a/ivl_target.h b/ivl_target.h index e122364e0..3643130ad 100644 --- a/ivl_target.h +++ b/ivl_target.h @@ -2360,7 +2360,7 @@ extern const char* ivl_type_prop_name(ivl_type_t net, int idx); extern ivl_type_t ivl_type_prop_type(ivl_type_t net, int idx); -#if defined(__MINGW32__) || defined (__CYGWIN32__) +#if defined(__MINGW32__) || defined (__CYGWIN__) # define DLLEXPORT __declspec(dllexport) #else # define DLLEXPORT diff --git a/main.cc b/main.cc index a499cc87c..451d43a2d 100644 --- a/main.cc +++ b/main.cc @@ -68,7 +68,7 @@ extern "C" int optind; extern "C" const char*optarg; #endif -#if defined(__CYGWIN32__) && !defined(HAVE_GETOPT_H) +#if defined(__CYGWIN__) && !defined(HAVE_GETOPT_H) extern "C" int getopt(int argc, char*argv[], const char*fmt); extern "C" int optind; extern "C" const char*optarg; diff --git a/sv_vpi_user.h b/sv_vpi_user.h index c4f96addd..37ff2358c 100644 --- a/sv_vpi_user.h +++ b/sv_vpi_user.h @@ -21,7 +21,7 @@ # include "vpi_user.h" -#if defined(__MINGW32__) || defined (__CYGWIN32__) +#if defined(__MINGW32__) || defined (__CYGWIN__) # define DLLEXPORT __declspec(dllexport) #else # define DLLEXPORT diff --git a/veriuser.h b/veriuser.h index 6b958f39e..beef27698 100644 --- a/veriuser.h +++ b/veriuser.h @@ -152,7 +152,7 @@ typedef struct t_tfcell */ extern s_tfcell veriusertfs[]; extern void veriusertfs_register_table(p_tfcell vtable); -#if defined(__MINGW32__) || defined (__CYGWIN32__) +#if defined(__MINGW32__) || defined (__CYGWIN__) extern __declspec(dllexport) void (*vlog_startup_routines[])(void); #endif diff --git a/vpi/libvpi.c b/vpi/libvpi.c index 3780521c1..5262d2e66 100644 --- a/vpi/libvpi.c +++ b/vpi/libvpi.c @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#if defined(__MINGW32__) || defined (__CYGWIN32__) +#if defined(__MINGW32__) || defined (__CYGWIN__) #include "vpi_user.h" #include diff --git a/vpi_modules.cc b/vpi_modules.cc index c8d99c9ac..ea0ccde2f 100644 --- a/vpi_modules.cc +++ b/vpi_modules.cc @@ -185,7 +185,7 @@ vpiHandle vpi_register_systf(const struct t_vpi_systf_data*ss) return 0; } -#if defined(__MINGW32__) || defined (__CYGWIN32__) +#if defined(__MINGW32__) || defined (__CYGWIN__) vpip_routines_s vpi_routines = { .register_cb = vpi_register_cb, .remove_cb = vpi_remove_cb, @@ -240,7 +240,7 @@ bool load_vpi_module(const char*path) return false; } -#if defined(__MINGW32__) || defined (__CYGWIN32__) +#if defined(__MINGW32__) || defined (__CYGWIN__) void*function = ivl_dlsym(dll, "vpip_set_callback"); if (function == 0) { cerr << "warning: '" << path << "' has no vpip_set_callback()" << endl; diff --git a/vpi_user.h b/vpi_user.h index 03f9c7c84..a918cbabc 100644 --- a/vpi_user.h +++ b/vpi_user.h @@ -20,7 +20,7 @@ */ -#if defined(__MINGW32__) || defined (__CYGWIN32__) +#if defined(__MINGW32__) || defined (__CYGWIN__) # define DLLEXPORT __declspec(dllexport) #else # define DLLEXPORT @@ -676,7 +676,7 @@ extern void vpip_count_drivers(vpiHandle ref, unsigned idx, # define _vpi_at_APV 6 #endif -#if defined(__MINGW32__) || defined (__CYGWIN32__) +#if defined(__MINGW32__) || defined (__CYGWIN__) /* * 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 @@ -731,7 +731,7 @@ typedef struct { extern DLLEXPORT PLI_UINT32 vpip_set_callback(vpip_routines_s*routines, PLI_UINT32 version); -#endif // defined(__MINGW32__) || defined (__CYGWIN32__) +#endif // defined(__MINGW32__) || defined (__CYGWIN__) EXTERN_C_END diff --git a/vvp/vpi_modules.cc b/vvp/vpi_modules.cc index fa35dd57f..3a669a899 100644 --- a/vvp/vpi_modules.cc +++ b/vvp/vpi_modules.cc @@ -30,7 +30,7 @@ static ivl_dll_t*dll_list = 0; static unsigned dll_list_cnt = 0; -#if defined(__MINGW32__) || defined (__CYGWIN32__) +#if defined(__MINGW32__) || defined (__CYGWIN__) typedef PLI_UINT32 (*vpip_set_callback_t)(vpip_routines_s*, PLI_UINT32); #endif typedef void (*vlog_startup_routines_t)(void); @@ -218,7 +218,7 @@ void vpip_load_module(const char*name) return; } -#if defined(__MINGW32__) || defined (__CYGWIN32__) +#if defined(__MINGW32__) || defined (__CYGWIN__) void*function = ivl_dlsym(dll, "vpip_set_callback"); if (function == 0) { fprintf(stderr, "%s: no vpip_set_callback()\n", name); diff --git a/vvp/vpi_priv.cc b/vvp/vpi_priv.cc index b83d5e686..44f402d86 100644 --- a/vvp/vpi_priv.cc +++ b/vvp/vpi_priv.cc @@ -1702,7 +1702,7 @@ extern "C" void vpip_count_drivers(vpiHandle ref, unsigned idx, rfp->node->count_drivers(idx, counts); } -#if defined(__MINGW32__) || defined (__CYGWIN32__) +#if defined(__MINGW32__) || defined (__CYGWIN__) vpip_routines_s vpi_routines = { .register_cb = vpi_register_cb, .remove_cb = vpi_remove_cb, diff --git a/vvp/vpi_priv.h b/vvp/vpi_priv.h index 213126183..604745589 100644 --- a/vvp/vpi_priv.h +++ b/vvp/vpi_priv.h @@ -48,7 +48,7 @@ typedef struct __vpiArray* vvp_array_t; * header file elsewhere. */ -#if defined(__MINGW32__) || defined (__CYGWIN32__) +#if defined(__MINGW32__) || defined (__CYGWIN__) extern vpip_routines_s vpi_routines; #endif