Skip to content

Commit

Permalink
chror: Rename all_test to efp_test
Browse files Browse the repository at this point in the history
  • Loading branch information
cwahn committed Feb 19, 2024
1 parent 9c32bbb commit 304a741
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
28 changes: 14 additions & 14 deletions include/efp/cpp_core.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,28 @@

#if defined(__STDC_HOSTED__) && __STDC_HOSTED__ == 1

#include <cstring>
#include <cstring>

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<char*>(dest);
const auto* s = static_cast<const char*>(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<char*>(dest);
const auto* s = static_cast<const char*>(src);
for (size_t i = 0; i < size; ++i) {
d[i] = s[i];
}
return dest;
}
} // namespace efp

#endif
Expand Down
6 changes: 3 additions & 3 deletions test/efp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
catch_discover_tests(efp_test)

0 comments on commit 304a741

Please sign in to comment.