From: Lukas Krickl Date: Sun, 15 Mar 2026 16:24:32 +0000 (+0100) Subject: stdlib: Added wrapper for strtol X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=1ac47d7a9984b706b895c9a9e78dffbba56794ca;p=lrts%2F.git stdlib: Added wrapper for strtol --- diff --git a/src/lrts.c b/src/lrts.c index 8f34d7c..57a9595 100644 --- a/src/lrts.c +++ b/src/lrts.c @@ -8,6 +8,7 @@ #include "t_map.h" #include "t_update.h" #include "u_time.h" +#include "u_stdlib.h" struct lrts_config lrts_global_cfg; struct lrts_state lrts_global_state; diff --git a/src/lrts_impl.h b/src/lrts_impl.h index 033fd0d..c735c1e 100644 --- a/src/lrts_impl.h +++ b/src/lrts_impl.h @@ -19,6 +19,7 @@ #include "p_posix/p_init.c" #include "p_posix/p_getopt.c" #include "p_pc/u_string.c" +#include "p_pc/u_stdlib.c" #else #error "No platform is provided" #endif diff --git a/src/p_pc/u_stdlib.c b/src/p_pc/u_stdlib.c new file mode 100644 index 0000000..0ef6eb4 --- /dev/null +++ b/src/p_pc/u_stdlib.c @@ -0,0 +1,5 @@ +#include "../u_stdlib.h" + +i64 u_strtol(const char *s, char **end, int base) { + return strtol(s, end, base); +} diff --git a/src/u_math.h b/src/u_math.h index 5dc7678..d81d077 100644 --- a/src/u_math.h +++ b/src/u_math.h @@ -61,4 +61,5 @@ lrts_bool u_point_in_rect(i32 x, i32 y, i32 rx, i32 ry, i32 rw, i32 rh); u_fp u_fp_sqrt(u_fp n); + #endif diff --git a/src/u_stdlib.h b/src/u_stdlib.h new file mode 100644 index 0000000..4179da1 --- /dev/null +++ b/src/u_stdlib.h @@ -0,0 +1,6 @@ +#ifndef U_STDLIB_H__ +#define U_STDLIB_H__ + +i64 u_strtol(const char *s, char **end, int base); + +#endif