stdlib: Added wrapper for strtol
authorLukas Krickl <lukas@krickl.dev>
Sun, 15 Mar 2026 16:24:32 +0000 (17:24 +0100)
committerLukas Krickl <lukas@krickl.dev>
Sun, 15 Mar 2026 16:24:32 +0000 (17:24 +0100)
src/lrts.c
src/lrts_impl.h
src/p_pc/u_stdlib.c [new file with mode: 0644]
src/u_math.h
src/u_stdlib.h [new file with mode: 0644]

index 8f34d7c3313fd7fdeff4a17d9a20d6fccaaa0fa6..57a95956a956f98469a688aa3ed8814057a3c2ee 100644 (file)
@@ -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;
index 033fd0d766e504e4473003e4b8da32cb31434dea..c735c1ebf402da64e414984ad72e7a069261d27c 100644 (file)
@@ -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 (file)
index 0000000..0ef6eb4
--- /dev/null
@@ -0,0 +1,5 @@
+#include "../u_stdlib.h"
+
+i64 u_strtol(const char *s, char **end, int base) {
+       return strtol(s, end, base);
+}
index 5dc7678c4a95f443b515bac536aa30e0f3b4e9e6..d81d07775e49579a0f6904a44377920a35243deb 100644 (file)
@@ -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 (file)
index 0000000..4179da1
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef U_STDLIB_H__
+#define U_STDLIB_H__
+
+i64 u_strtol(const char *s, char **end, int base);
+
+#endif