Files
hackerlibultra/include/compiler/modern_gcc/stdlib.h
someone2639 c366e0122a Format the Repo (#3)
* set build options

* remove COMPARE and MDOERN_* switches

* remove tools makefile

* AR patching is gone too since we want a fullly decomped version

* AR is modern

* remove cwd changes

* edit my own tool to fix compile errors

* compile files generated with my own tool instead of the originals

* inline modern_gcc makefile

* port mips toolchain detection logic

* add util.mk for find-command

* remove forced AR order and strip/mdebug removal commands

* add -mabi=32 to as flags

* formatting changes

* add clang format files

* formatting changes

* make libgultra CI work

* install mips gcc too

* add format check tools

* Add formatting to CI

* Add CI (#4)

* make libgultra CI work

* install mips gcc too

* remove make setup

---------

Co-authored-by: someone2639 <someone2639@gmail.com>

* we don't use clang-tidy

* use 120 width for formatting

* a

* address clang-tidy messing up

* test

* align consecutive macros and declarations

* only align macros for now

* SpaceAfterCStyleCast: false

* format headers too

* remove cast space switch because its false by default

* pointers on left

* AlignConsecutiveBitFields: true

* install clang-format and clang-tidy on gh actions

* and clang-tools

* show diff in format check tool

* make CI work

---------

Co-authored-by: someone2639 <someone2639@gmail.com>
🙏
2025-02-17 22:56:09 -05:00

81 lines
1.4 KiB
C

#ifndef _STDLIB_H
#define _STDLIB_H
/*
stdlib.h
*/
#ifndef _SIZE_T_DEF
#define _SIZE_T_DEF
typedef unsigned size_t;
#endif
#ifndef _DIV_T_DEF
#define _DIV_T_DEF
typedef struct DIV_T {
int quot;
int rem;
} div_t;
#endif
#ifndef _LDIV_T_DEF
#define _LDIV_T_DEF
typedef struct LDIV_T {
long quot;
long rem;
} ldiv_t;
#endif
#ifndef _LLDIV_T_DEF
#define _LLDIV_T_DEF
typedef struct lldiv_t {
long long quot;
long long rem;
} lldiv_t;
#endif
#ifndef NULL
#define NULL 0
#endif
#define _max(a, b) (((a) > (b)) ? (a) : (b))
#define _min(a, b) (((a) < (b)) ? (a) : (b))
#define RAND_MAX 32767
int rand(void);
void srand(unsigned);
int abs(int);
long labs(long);
div_t div(int, int);
ldiv_t ldiv(long, long);
lldiv_t lldiv(long long, long long);
int atoi(const char*);
long atol(const char*);
long strtol(const char*, char**, int);
unsigned long strtoul(const char*, char**, int);
char* itoa(int, char*, int);
char* ltoa(long, char*, int);
char* ultoa(unsigned long, char*, int);
double atof(const char*);
double strtod(const char*, char**);
void qsort(void*, size_t, size_t, int (*)(const void*, const void*));
void* bsearch(const void*, const void*, size_t, size_t, int (*)(const void*, const void*));
void* malloc(size_t);
void* calloc(size_t, size_t);
void* realloc(void*, size_t);
void free(void*);
void exit(int);
void abort(void);
#endif