aboutsummaryrefslogtreecommitdiff
path: root/tests/libs/dlopen_testlib_ifunc_variable_impl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/libs/dlopen_testlib_ifunc_variable_impl.cpp')
-rw-r--r--tests/libs/dlopen_testlib_ifunc_variable_impl.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/libs/dlopen_testlib_ifunc_variable_impl.cpp b/tests/libs/dlopen_testlib_ifunc_variable_impl.cpp
index 4b13ebab3..624ae7499 100644
--- a/tests/libs/dlopen_testlib_ifunc_variable_impl.cpp
+++ b/tests/libs/dlopen_testlib_ifunc_variable_impl.cpp
@@ -43,11 +43,13 @@ extern "C" const char* var_false = "false";
extern "C" const char* v1 = "unset";
extern "C" const char* v2 = "set";
-extern "C" void* is_ctor_called_ifun() {
- return g_flag == 0 ? &var_false : &var_true;
+typedef const char* (*fn_ptr)();
+
+extern "C" fn_ptr is_ctor_called_ifun() {
+ return (fn_ptr)(g_flag == 0 ? &var_false : &var_true);
}
-extern "C" void* foo_ifunc() {
- char* choice = getenv("IFUNC_CHOICE");
- return choice == nullptr ? &v1 : &v2;
+extern "C" fn_ptr foo_ifunc() {
+ char* choice = getenv("IFUNC_CHOICE");
+ return (fn_ptr)(choice == nullptr ? &v1 : &v2);
}