diff --git a/CMakeLists.txt b/CMakeLists.txt index 49f89bb..c38b2df 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,7 +21,7 @@ target_include_directories(mach_detours add_executable(mach_detours_sample - sample/main.cpp + sample/main.c ) target_link_libraries(mach_detours_sample PRIVATE mach_detours diff --git a/sample/main.cpp b/sample/main.c similarity index 70% rename from sample/main.cpp rename to sample/main.c index 1a380a1..88a7d94 100644 --- a/sample/main.cpp +++ b/sample/main.c @@ -1,7 +1,7 @@ // Copyright (c) Lysann Tranvouez. All rights reserved. -#include -#include +#include +#include #include "mach_detours.h" @@ -22,7 +22,7 @@ int main(int argc, const char* argv[]) assert(counter == 0); detour_transaction_begin(); - detour_attach(reinterpret_cast(&real_strerror), reinterpret_cast(my_strerror)); + detour_attach((detour_func_t*)&real_strerror, (detour_func_t)my_strerror); detour_transaction_commit(); assert(counter == 0); @@ -30,7 +30,7 @@ int main(int argc, const char* argv[]) assert(counter == 1); detour_transaction_begin(); - detour_detach(reinterpret_cast(&real_strerror), reinterpret_cast(my_strerror)); + detour_detach((detour_func_t*)&real_strerror, (detour_func_t)my_strerror); detour_transaction_commit(); assert(counter == 1);