...
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#include "mem.h"
|
||||
#include <stdint.h>
|
||||
#include "stdint.h"
|
||||
|
||||
void memset(void* destination, uint8_t value, size_t length)
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include "stddef.h"
|
||||
#include "stdint.h"
|
||||
|
||||
void memset(void* destination, uint8_t value, size_t length);
|
||||
8
src/stdlib/stdarg.h
Normal file
8
src/stdlib/stdarg.h
Normal file
@@ -0,0 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
typedef __builtin_va_list va_list;
|
||||
|
||||
#define va_start(ap, last) __builtin_va_start(ap, last)
|
||||
#define va_arg(ap, type) __builtin_va_arg(ap, type)
|
||||
#define va_end(ap) __builtin_va_end(ap)
|
||||
#define va_copy(dest, src) __builtin_va_copy(dest, src)
|
||||
7
src/stdlib/stdbool.h
Normal file
7
src/stdlib/stdbool.h
Normal file
@@ -0,0 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#define bool _Bool
|
||||
#define true 1
|
||||
#define false 0
|
||||
|
||||
#define __bool_true_false_are_defined 1
|
||||
12
src/stdlib/stddef.h
Normal file
12
src/stdlib/stddef.h
Normal file
@@ -0,0 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL ((void*)0)
|
||||
#endif
|
||||
|
||||
typedef unsigned long size_t;
|
||||
typedef long ptrdiff_t;
|
||||
typedef long intptr_t;
|
||||
typedef unsigned long uintptr_t;
|
||||
|
||||
#define offsetof(type, member) __builtin_offsetof(type, member)
|
||||
50
src/stdlib/stdint.h
Normal file
50
src/stdlib/stdint.h
Normal file
@@ -0,0 +1,50 @@
|
||||
#pragma once
|
||||
|
||||
typedef signed char int8_t;
|
||||
typedef unsigned char uint8_t;
|
||||
typedef signed short int16_t;
|
||||
typedef unsigned short uint16_t;
|
||||
typedef signed int int32_t;
|
||||
typedef unsigned int uint32_t;
|
||||
typedef signed long long int64_t;
|
||||
typedef unsigned long long uint64_t;
|
||||
|
||||
typedef uint8_t u8;
|
||||
typedef int8_t i8;
|
||||
typedef uint16_t u16;
|
||||
typedef int16_t i16;
|
||||
typedef uint32_t u32;
|
||||
typedef int32_t i32;
|
||||
typedef uint64_t u64;
|
||||
typedef int64_t i64;
|
||||
|
||||
#define INT8_MIN (-128)
|
||||
#define INT8_MAX 127
|
||||
#define UINT8_MAX 0xff
|
||||
|
||||
#define INT16_MIN (-32768)
|
||||
#define INT16_MAX 32767
|
||||
#define UINT16_MAX 0xffff
|
||||
|
||||
#define INT32_MIN (-2147483647 - 1)
|
||||
#define INT32_MAX 2147483647
|
||||
#define UINT32_MAX 0xffffffffU
|
||||
|
||||
#define INT64_MIN (-9223372036854775807LL - 1)
|
||||
#define INT64_MAX 9223372036854775807LL
|
||||
#define UINT64_MAX 0xffffffffffffffffULL
|
||||
|
||||
#define INT8_C(x) x
|
||||
#define UINT8_C(x) x##U
|
||||
|
||||
#define INT16_C(x) x
|
||||
#define UINT16_C(x) x##U
|
||||
|
||||
#define INT32_C(x) x
|
||||
#define UINT32_C(x) x##U
|
||||
|
||||
#define INT64_C(x) x##LL
|
||||
#define UINT64_C(x) x##ULL
|
||||
|
||||
#define INTMAX_C(x) x##LL
|
||||
#define UINTMAX_C(x) x##ULL
|
||||
@@ -1,9 +1,9 @@
|
||||
#include "stdio.h"
|
||||
#include "../arch/arch.h"
|
||||
#include "stdarg.h"
|
||||
#include "stdbool.h"
|
||||
#include "stddef.h"
|
||||
#include "string.h"
|
||||
#include <stdarg.h>
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
|
||||
void printf(const char* fmt, ...)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user