Fix utility not using the correct functions for runtime

This commit is contained in:
rexy712 2022-06-29 17:34:26 -07:00
parent 31327248e0
commit 1165165657
2 changed files with 5 additions and 5 deletions

View File

@ -20,7 +20,7 @@
#if defined(__cpp_if_consteval)
#define REXY_if_consteval if consteval
#define REXY_if_consteval if not consteval
#define REXY_if_not_consteval if not consteval
#elif defined(__cpp_lib_is_constant_evaluated)
#include <type_traits> //is_constant_evaluated
#define REXY_if_consteval if(std::is_constant_evaluated())

View File

@ -99,7 +99,7 @@ namespace rexy{
}
template<class T>
constexpr int strcmp(const T* l, const T* r)noexcept{
REXY_if_consteval{
REXY_if_not_consteval{
if constexpr(std::is_same_v<std::remove_cvref_t<T>,char>){
return std::strcmp(l, r);
}else if constexpr(std::is_same_v<std::remove_cvref_t<T>,wchar_t>){
@ -111,7 +111,7 @@ namespace rexy{
}
template<class T>
constexpr int strncmp(const T* l, const T* r, std::size_t max)noexcept{
REXY_if_consteval{
REXY_if_not_consteval{
if constexpr(std::is_same_v<std::remove_cvref_t<T>,char>){
return std::strncmp(l, r, max);
}else if constexpr (std::is_same_v<std::remove_cvref_t<T>,wchar_t>){
@ -123,7 +123,7 @@ namespace rexy{
}
template<class T, class Compare>
constexpr int strncmp(const T* l, const T* r, std::size_t max, Compare cmp)noexcept{
REXY_if_consteval{
REXY_if_not_consteval{
if constexpr(std::is_same_v<std::remove_cvref_t<T>,char>){
return std::strncmp(l, r, max);
}else if constexpr (std::is_same_v<std::remove_cvref_t<T>,wchar_t>){
@ -139,7 +139,7 @@ namespace rexy{
return *l - *r;
}
constexpr void memcpy(void* l, const void* r, std::size_t n){
REXY_if_consteval{
REXY_if_not_consteval{
std::memcpy(l, r, n);
}else{
char* ld = static_cast<char*>(l);