From 6c6f7eb902134c851bcb84edd3d8b6a7dc93dae4 Mon Sep 17 00:00:00 2001 From: NukeBird Date: Sun, 30 Nov 2025 18:35:17 +0300 Subject: [PATCH] Use wildcard for *.c files --- axl_string.cpp | 21 +++++++++++++++++++++ makefile | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/axl_string.cpp b/axl_string.cpp index 12a7111..0d312a1 100644 --- a/axl_string.cpp +++ b/axl_string.cpp @@ -98,3 +98,24 @@ i32 axl_strcmp(const i8* s1, const i8* s2) return 0; } + +i32 axl_strncmp(const i8* s1, const i8* s2, u32 n) +{ + if (!s1 || !s2) + { + return (s1 == s2) ? 0 : (!s1 ? -1 : 1); + } + + for (u32 i = 0; i < n; s1++, s2++) + { + u8 c1 = *(const u8*)s1; + u8 c2 = *(const u8*)s2; + + if (c1 != c2 || c1 == '\0' || c2 == '\0') + { + return c1 - c2; + } + } + + return 0; +} diff --git a/makefile b/makefile index ac4ff12..52d5224 100644 --- a/makefile +++ b/makefile @@ -2,7 +2,7 @@ CC = clang CFLAGS = -Wall -Wextra -Werror -pedantic -std=c11 -nostdlib -static -Oz -ffreestanding LDFLAGS = -Wl,/SUBSYSTEM:CONSOLE,/ENTRY:_start -fuse-ld=lld LIBS = -lkernel32 -SOURCES = main.c axl_memory.c +SOURCES = $(wildcard *.c) TARGET = prog.exe all: clean $(TARGET)