From a198a3c1e10a4b56a968de7eb277ed12484516eb Mon Sep 17 00:00:00 2001 From: Geza Lore Date: Thu, 24 Jun 2021 16:48:58 +0100 Subject: [PATCH] Add extern "C" to function declarations in VPI tests. These are necessary to link the executables. So far we have been saved by one of the generated headers forward declaring these functions with extern "C", but changing that header would break these tests. --- test_regress/t/t_vpi_get.cpp | 2 +- test_regress/t/t_vpi_memory.cpp | 2 +- test_regress/t/t_vpi_param.cpp | 2 +- test_regress/t/t_vpi_unimpl.cpp | 2 +- test_regress/t/t_vpi_var.cpp | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test_regress/t/t_vpi_get.cpp b/test_regress/t/t_vpi_get.cpp index 592246b3b..3b1d41d07 100644 --- a/test_regress/t/t_vpi_get.cpp +++ b/test_regress/t/t_vpi_get.cpp @@ -202,7 +202,7 @@ int mon_check_props() { return 0; } -int mon_check() { +extern "C" int mon_check() { // Callback from initial block in monitor if (int status = mon_check_props()) return status; return 0; // Ok diff --git a/test_regress/t/t_vpi_memory.cpp b/test_regress/t/t_vpi_memory.cpp index 3dc17b55a..b6b1a83df 100644 --- a/test_regress/t/t_vpi_memory.cpp +++ b/test_regress/t/t_vpi_memory.cpp @@ -213,7 +213,7 @@ void _mon_check_memory() { } } -int mon_check() { +extern "C" int mon_check() { // Callback from initial block in monitor _mon_check_memory(); return errors; diff --git a/test_regress/t/t_vpi_param.cpp b/test_regress/t/t_vpi_param.cpp index ac6275b15..cee164fe3 100644 --- a/test_regress/t/t_vpi_param.cpp +++ b/test_regress/t/t_vpi_param.cpp @@ -203,7 +203,7 @@ int _mon_check_param() { return status; } -int mon_check() { +extern "C" int mon_check() { // Callback from initial block in monitor if (int status = _mon_check_param()) return status; return 0; // Ok diff --git a/test_regress/t/t_vpi_unimpl.cpp b/test_regress/t/t_vpi_unimpl.cpp index 5706be271..816c9eca3 100644 --- a/test_regress/t/t_vpi_unimpl.cpp +++ b/test_regress/t/t_vpi_unimpl.cpp @@ -176,7 +176,7 @@ int _mon_check_unimpl(p_cb_data cb_data) { return 0; // Ok } -int mon_check() { +extern "C" int mon_check() { // Callback from initial block in monitor if (int status = _mon_check_unimpl(NULL)) return status; return 0; // Ok diff --git a/test_regress/t/t_vpi_var.cpp b/test_regress/t/t_vpi_var.cpp index 9ddd720e2..2861d58b8 100644 --- a/test_regress/t/t_vpi_var.cpp +++ b/test_regress/t/t_vpi_var.cpp @@ -638,7 +638,7 @@ int _mon_check_vlog_info() { return 0; } -int mon_check() { +extern "C" int mon_check() { // Callback from initial block in monitor #ifdef TEST_VERBOSE printf("-mon_check()\n");