-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathstdarg.h
More file actions
40 lines (24 loc) · 697 Bytes
/
stdarg.h
File metadata and controls
40 lines (24 loc) · 697 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#ifndef mclib_stdarg_h__17_12_07____16_47_53
#define mclib_stdarg_h__17_12_07____16_47_53
#include <mclib.h>
#include <stdlib.h>
/**
* FIXME: Requires co-operation with the compiler to implement.
* TODO: Implement Variadic Function Complete Implementation.
*/
typedef char* va_list;
static void __va_start_impl(va_list* list,void* from)
{
*list = from;
}
static void* __va_arg_impl(va_list* list,int size){
void* t = *list;
*list +=size;
return t;
}
static void __va_end_impl(va_list* list){
}
#define va_start(list,from) __va_start_impl(&list,(&from)+1)
#define va_arg(list,type) *(type*)(__va_arg_impl(&list,sizeof(type)))
#define va_end(list) __va_end_impl(&list)
#endif