varargs.h (21673) | varargs.h (22415) |
---|---|
1/*- 2 * Copyright (c) 1990, 1993 3 * The Regents of the University of California. All rights reserved. 4 * (c) UNIX System Laboratories, Inc. 5 * All or some portions of this file are derived from material licensed 6 * to the University of California by American Telephone and Telegraph 7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with 8 * the permission of UNIX System Laboratories, Inc. --- 22 unchanged lines hidden (view full) --- 31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 36 * SUCH DAMAGE. 37 * 38 * @(#)varargs.h 8.2 (Berkeley) 3/22/94 | 1/*- 2 * Copyright (c) 1990, 1993 3 * The Regents of the University of California. All rights reserved. 4 * (c) UNIX System Laboratories, Inc. 5 * All or some portions of this file are derived from material licensed 6 * to the University of California by American Telephone and Telegraph 7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with 8 * the permission of UNIX System Laboratories, Inc. --- 22 unchanged lines hidden (view full) --- 31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 36 * SUCH DAMAGE. 37 * 38 * @(#)varargs.h 8.2 (Berkeley) 3/22/94 |
39 * $FreeBSD: head/sys/amd64/include/varargs.h 21673 1997-01-14 07:20:47Z jkh $ | 39 * $FreeBSD: head/sys/amd64/include/varargs.h 22415 1997-02-07 20:22:15Z phk $ |
40 */ 41 42#ifndef _VARARGS_H_ 43#define _VARARGS_H_ 44 45typedef char *va_list; 46 | 40 */ 41 42#ifndef _VARARGS_H_ 43#define _VARARGS_H_ 44 45typedef char *va_list; 46 |
47#define va_dcl int va_alist; | 47#ifdef __GNUC__ 48#define va_alist __builtin_va_alist 49#define va_dcl int va_alist; ... 50#else /* !__GNUC__ */ 51#define va_dcl int va_alist; 52#endif |
48 49#define va_start(ap) \ 50 ap = (char *)&va_alist 51 52#ifdef KERNEL 53#define va_arg(ap, type) \ 54 ((type *)(ap += sizeof(type)))[-1] 55#else 56#define va_arg(ap, type) \ 57 ((type *)(ap += sizeof(type) < sizeof(int) ? \ 58 (abort(), 0) : sizeof(type)))[-1] 59#endif 60 61#define va_end(ap) 62 63#endif /* !_VARARGS_H_ */ | 53 54#define va_start(ap) \ 55 ap = (char *)&va_alist 56 57#ifdef KERNEL 58#define va_arg(ap, type) \ 59 ((type *)(ap += sizeof(type)))[-1] 60#else 61#define va_arg(ap, type) \ 62 ((type *)(ap += sizeof(type) < sizeof(int) ? \ 63 (abort(), 0) : sizeof(type)))[-1] 64#endif 65 66#define va_end(ap) 67 68#endif /* !_VARARGS_H_ */ |