📄 stdarg.h
字号:
/*
**
** FILE: stdarg.h
**
** SCCS: @(#)stdarg.h 1.2
**
** CREATED: Wed Jan 4 1995
**
** AUTHOR: Kees de Bruin
** <bruin@tasking.nl>
**
** COPYRIGHT: (C) 1995, Tasking Software B.V.
**
** DESCRIPTION:
**
** Macros and types for variable argument list to a function
**
** CHANGE LOG:
**
** 1.2 Changed the macros to match those defined by Watcom.
** The sizeof() is replaced by a macro call which will round
** the original sizeof() up to the nearest multiple of
** sizeof(int).
**
** 1.1 Inital version from Intel
** */
#ifndef __STDARG_H
#define __STDARG_H
#ifndef __VA_LIST
#define __VA_LIST
typedef char *va_list[1];
#endif /* __VA_LIST */
/*
** The following macro will determine the size of a type, variable or expression, rounded up to the nearest
** multiple of sizeof(int). This number is its size as function argument.
**
** NOTE: sizeof(int) must be a power of 2!
*/
#define _INTSIZEOF(_type) ( (sizeof(_type) + sizeof(int) - 1) & ~(sizeof(int) - 1) )
#define va_start( _ap, _arg ) ( (_ap)[0] = (char *)&_arg + _INTSIZEOF( _arg ), (void)0 )
#define va_arg( _ap, _type ) ( (_ap)[0] += _INTSIZEOF( _type ), \
( * (_type *)((_ap)[0] - _INTSIZEOF( _type )) ) )
#define va_end( _ap ) ( (_ap)[0] = 0, (void)0 )
#endif /* __STDARG_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -