From 3e28cf4b435a5818b46af8eade2a5897028bf92c Mon Sep 17 00:00:00 2001 From: johanknol Date: Tue, 13 Feb 2001 20:19:37 +0000 Subject: [PATCH] simplified git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@616 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- device/include/stdarg.h | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/device/include/stdarg.h b/device/include/stdarg.h index c535af32..85a7f5d9 100644 --- a/device/include/stdarg.h +++ b/device/include/stdarg.h @@ -1,30 +1,20 @@ -/*-----------------------------------------------------------------------------------*/ -/* stdarg.h - ANSI macros for variable parameter list */ -/*-----------------------------------------------------------------------------------*/ +/*-------------------------------------------------------------------------*/ +/* stdarg.h - ANSI macros for variable parameter list */ +/*-------------------------------------------------------------------------*/ -#ifndef __SDC51_STDARG_H -#define __SDC51_STDARG_H 1 - -#if defined(SDCC_STACK_TENBIT) +#ifndef _STDARG_H +#define _STDARG_H 1 +#if defined(SDCC_MODEL_LARGE) || defined(SDCC_MODEL_FLAT24) typedef unsigned char _xdata * va_list ; -#define va_arg(marker,type) *((type _xdata * )(marker -= sizeof(type))) -#define va_start(marker,first) { marker = (va_list) ((char _xdata * )&first) ; } - #elif defined(SDCC_USE_XSTACK) - typedef unsigned char _pdata * va_list ; -#define va_arg(marker,type) *((type _data * )(marker -= sizeof(type))) -#define va_start(marker,first) { marker = (va_list) ((char _pdata * )&first) ; } - #else - typedef unsigned char _data * va_list ; -#define va_arg(marker,type) *((type _data * )(marker -= sizeof(type))) -#define va_start(marker,first) { marker = (va_list) ((char _data * )&first) ; } - #endif -#define va_end(marker) marker = (va_list) 0; +#define va_arg(valist,type) (*((type *)(valist -= sizeof(type)))) +#define va_start(valist,first) (valist = (va_list)&(first)) +#define va_end(valist) (valist = (va_list) 0) #endif -- 2.30.2