Thursday, July 20, 2006

Possible implementation of va_list


I found this in C/C++ Users Journal Jan 1990

typedef int * va_list;

#define va_start (arg_ptr, first_param) (arg_ptr= (va_list) (&first_param+1))
#define va_arg(arg_ptr,type) (* (((type*) (arg_ptr= (va_list) ((type*) arg_ptr) +1))-1))
#define va_end(arg_ptr) \
(arg_ptr=NULL)

No comments: