LibC: Add some new functions

This commit is contained in:
Bananymous 2022-12-13 00:51:57 +02:00
parent 90632de834
commit f4b614aa61
3 changed files with 11 additions and 2 deletions

View File

@ -15,8 +15,8 @@ LIBDIR?=$(EXEC_PREFIX)/lib
CFLAGS:=$(CFLAGS) -D__is_libc -Iinclude -ffreestanding -Wall -Wextra
CPPFLAGS:=$(CPPFLAGS)
LIBK_CFLAGS:=$(CFLAGS)
LIBK_CPPFLAGS:=$(CPPFLAGS) -D__is_libk
LIBK_CFLAGS:=$(CFLAGS) -D__is_libk
LIBK_CPPFLAGS:=$(CPPFLAGS)
ARCHDIR=arch/$(HOSTARCH)

5
libc/include/assert.h Normal file
View File

@ -0,0 +1,5 @@
#pragma once
#include <stdlib.h>
#define assert(expr) { if (!(expr)) abort(); }

4
libc/include/sys/param.h Normal file
View File

@ -0,0 +1,4 @@
#pragma once
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define MAX(a, b) ((a) > (b) ? (a) : (b))