Initial commit of current C compiler sources, partly rebranded but not yet properly cleaned up!
This commit is contained in:
27
fakelibc/stdarg.h
Normal file
27
fakelibc/stdarg.h
Normal 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
|
Reference in New Issue
Block a user