core/irrt: use __builtin_strlen
This commit is contained in:
parent
77bf76dbdd
commit
925bf47f4e
|
@ -1,20 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include <irrt/int_types.hpp>
|
||||
|
||||
namespace cstr
|
||||
{
|
||||
/**
|
||||
* @brief Implementation of `strlen()`.
|
||||
*/
|
||||
uint32_t length(const char *str)
|
||||
{
|
||||
uint32_t length = 0;
|
||||
while (*str != '\0')
|
||||
{
|
||||
length++;
|
||||
str++;
|
||||
}
|
||||
return length;
|
||||
}
|
||||
} // namespace cstr
|
|
@ -1,7 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include <irrt/cslice.hpp>
|
||||
#include <irrt/cstr_util.hpp>
|
||||
#include <irrt/int_types.hpp>
|
||||
|
||||
/**
|
||||
|
@ -53,11 +52,11 @@ void _raise_exception_helper(ExceptionId id, const char *filename, int32_t line,
|
|||
{
|
||||
Exception<SizeT> e = {
|
||||
.id = id,
|
||||
.filename = {.base = (uint8_t *)filename, .len = (int32_t)cstr::length(filename)},
|
||||
.filename = {.base = (uint8_t *)filename, .len = __builtin_strlen(filename)},
|
||||
.line = line,
|
||||
.column = 0,
|
||||
.function = {.base = (uint8_t *)function, .len = (int32_t)cstr::length(function)},
|
||||
.msg = {.base = (uint8_t *)msg, .len = (int32_t)cstr::length(msg)},
|
||||
.function = {.base = (uint8_t *)function, .len = __builtin_strlen(function)},
|
||||
.msg = {.base = (uint8_t *)msg, .len = __builtin_strlen(msg)},
|
||||
};
|
||||
e.params[0] = param0;
|
||||
e.params[1] = param1;
|
||||
|
|
Loading…
Reference in New Issue