Initial commit of current C compiler sources, partly rebranded but not yet properly cleaned up!

This commit is contained in:
2025-06-04 03:45:05 +10:00
parent 6e217b2669
commit 7f74463109
33 changed files with 18135 additions and 0 deletions

27
fakelibc/stdarg.h Normal file
View File

@@ -0,0 +1,27 @@
#ifndef _FAKELIBC_STDARG_H
#define _FAKELIBC_STDARG_H
// TODO: This will basically not work except for the simplest printf-like cases
typedef long long** va_list;
#define _VA_CHECK() \
if (__builtin_func_callconv != 101) {\
printf("ERROR: Unpacking varargs currently only works with __classic_call (#101). Function %s uses convention %d instead.\n", __func__, __builtin_func_callconv);\
}
#define va_start(list,lastarg) \
do {\
_VA_CHECK();\
list = &lastarg;\
list++;\
} while(0)
#define va_arg(list,T) \
(T)(list++)
#define va_end(list) \
do {list = (void*)0;} while(0)
/* From ifndef at top of file: */
#endif