merge main

This commit is contained in:
petrie911
2023-10-14 09:03:14 -05:00
1454 changed files with 63286 additions and 34455 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
#ifndef ALLOCA_H
#define ALLOCA_H
#ifndef LIBC_ALLOCA_H
#define LIBC_ALLOCA_H
void* alloca(u32);
#define alloca __builtin_alloca
-4
View File
@@ -1,4 +0,0 @@
#ifndef ASSERT_H
#define ASSERT_H
#endif
+6 -19
View File
@@ -1,5 +1,5 @@
#ifndef MATH_H
#define MATH_H
#ifndef LIBC_MATH_H
#define LIBC_MATH_H
#include "PR/ultratypes.h"
@@ -11,25 +11,12 @@
#define SHT_MAX 32767.0f
#define SHT_MINV (1.0f / SHT_MAX)
typedef union {
f64 d;
struct {
u32 hi;
u32 lo;
} word;
} du;
typedef union {
u32 i;
f32 f;
} fu;
extern f32 __libm_qnan_f;
float fabsf(float f);
#pragma intrinsic(fabsf)
float sqrtf(float f);
#pragma intrinsic(sqrtf)
#ifdef __GNUC__
#define fabsf(f) __builtin_fabsf((float)(f))
#endif
double sqrt(double d);
#pragma intrinsic(sqrt)
+2 -4
View File
@@ -1,7 +1,5 @@
#ifndef STDARG_H
#define STDARG_H
#include "ultra64.h"
#ifndef LIBC_STDARG_H
#define LIBC_STDARG_H
// When building with GCC, use the official vaarg macros to avoid warnings
// and possibly bad codegen.
+2 -2
View File
@@ -1,5 +1,5 @@
#ifndef STDBOOL
#define STDBOOL
#ifndef LIBC_STDBOOL_H
#define LIBC_STDBOOL_H
#define __bool_true_false_are_defined 1
+2 -8
View File
@@ -1,16 +1,10 @@
#ifndef STDDEF_H
#define STDDEF_H
#ifndef LIBC_STDDEF_H
#define LIBC_STDDEF_H
#include "PR/ultratypes.h"
typedef u32 size_t;
typedef s32 ptrdiff_t;
#ifndef NULL
#define NULL (void*)0
#endif
#ifdef __GNUC__
#define offsetof(structure, member) __builtin_offsetof (structure, member)
#else
+2 -2
View File
@@ -1,5 +1,5 @@
#ifndef STDINT_H
#define STDINT_H
#ifndef LIBC_STDINT_H
#define LIBC_STDINT_H
#include "PR/ultratypes.h"
+5 -2
View File
@@ -1,5 +1,5 @@
#ifndef STDLIB_H
#define STDLIB_H
#ifndef LIBC_STDLIB_H
#define LIBC_STDLIB_H
#include "libc/stddef.h"
@@ -22,4 +22,7 @@ typedef int ssize_t;
typedef long wchar_t;
ldiv_t ldiv(long numer, long denom);
lldiv_t lldiv(long long numer, long long denom);
#endif /* STDLIB_H */
+12
View File
@@ -0,0 +1,12 @@
#ifndef LIBC_STRING_H
#define LIBC_STRING_H
#include "libc/stddef.h"
const char* strchr(const char* s, int c);
size_t strlen(const char* s);
void* memcpy(void* s1, const void* s2, size_t n);
#endif