diff --git a/include/efp/cpp_core.hpp b/include/efp/cpp_core.hpp index d629701..ec05c28 100644 --- a/include/efp/cpp_core.hpp +++ b/include/efp/cpp_core.hpp @@ -17,28 +17,28 @@ #if defined(__STDC_HOSTED__) && __STDC_HOSTED__ == 1 -#include + #include namespace efp { - // Use a function alias for clarity and avoid direct assignment to avoid potential confusion. - inline void* _memcpy(void* dest, const void* src, size_t size) { - return std::memcpy(dest, src, size); - } +// Use a function alias for clarity and avoid direct assignment to avoid potential confusion. +inline void* _memcpy(void* dest, const void* src, size_t size) { + return std::memcpy(dest, src, size); } +} // namespace efp #else namespace efp { - // Custom memcpy implementation for freestanding environments. - // Added extern "C" to ensure C linkage for compatibility with C libraries or code. - extern "C" void* _memcpy(void* dest, const void* src, size_t size) { - auto* d = static_cast(dest); - const auto* s = static_cast(src); - for (size_t i = 0; i < size; ++i) { - d[i] = s[i]; - } - return dest; +// Custom memcpy implementation for freestanding environments. +// Added extern "C" to ensure C linkage for compatibility with C libraries or code. +extern "C" void* _memcpy(void* dest, const void* src, size_t size) { + auto* d = static_cast(dest); + const auto* s = static_cast(src); + for (size_t i = 0; i < size; ++i) { + d[i] = s[i]; } + return dest; +} } // namespace efp #endif diff --git a/test/efp/CMakeLists.txt b/test/efp/CMakeLists.txt index 4ad1d50..3fa2f50 100644 --- a/test/efp/CMakeLists.txt +++ b/test/efp/CMakeLists.txt @@ -17,10 +17,10 @@ endif() include(Catch) enable_testing() -add_executable(all_test test.cpp) -target_link_libraries(all_test +add_executable(efp_test test.cpp) +target_link_libraries(efp_test PRIVATE Catch2::Catch2WithMain efp) -catch_discover_tests(all_test) \ No newline at end of file +catch_discover_tests(efp_test) \ No newline at end of file