From 237bba6e56b4c0ae884eb35441d6e9960a24b3ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Mon, 2 Apr 2007 14:00:33 +0000 Subject: [PATCH] feat: pour l'utilisation des listes d'arguments a taille variable --- include/stdarg.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 include/stdarg.h diff --git a/include/stdarg.h b/include/stdarg.h new file mode 100644 index 0000000..6e44647 --- /dev/null +++ b/include/stdarg.h @@ -0,0 +1,21 @@ +#ifndef _VA_LIST_T_H +#define _VA_LIST_T_H + +#define __GNUC_VA_LIST + +typedef void *__gnuc_va_list; + +#define __va_rounded_size(TYPE) (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int)) + +#define va_start(AP, LASTARG) (AP = ((__gnuc_va_list) __builtin_next_arg (LASTARG))) + +void va_end (__gnuc_va_list); +#define va_end(AP) ((void)0) + +#define va_arg(AP, TYPE) (AP = (__gnuc_va_list) ((char *) (AP) + __va_rounded_size (TYPE)), *((TYPE *) (void *) ((char *) (AP) - __va_rounded_size (TYPE)))) + +#define __va_copy(dest, src) (dest) = (src) + +typedef __gnuc_va_list va_list; + +#endif