xref: /netbsd-src/sys/external/bsd/gnu-efi/dist/inc/efistdarg.h (revision b7b7574d3bf8eeb51a1fa3977b59142ec6434a55)
1 /*	$NetBSD: efistdarg.h,v 1.2 2014/04/08 17:55:18 jakllsch Exp $	*/
2 
3 #ifndef _EFISTDARG_H_
4 #define _EFISTDARG_H_
5 
6 /*++
7 
8 Copyright (c) 1998  Intel Corporation
9 
10 Module Name:
11 
12     devpath.h
13 
14 Abstract:
15 
16     Defines for parsing the EFI Device Path structures
17 
18 
19 
20 Revision History
21 
22 --*/
23 #ifdef __GNUC__
24 #ifdef __NetBSD__
25 #include <sys/stdarg.h>
26 #else
27 #include "stdarg.h"
28 #endif
29 #else
30 #define _INTSIZEOF(n)   ( (sizeof(n) + sizeof(UINTN) - 1) & ~(sizeof(UINTN) - 1) )
31 
32 typedef CHAR8 * va_list;
33 
34 #define va_start(ap,v)  ( ap = (va_list)&v + _INTSIZEOF(v) )
35 #define va_arg(ap,t)    ( *(t *)((ap += _INTSIZEOF(t)) - _INTSIZEOF(t)) )
36 #define va_end(ap)  ( ap = (va_list)0 )
37 #endif
38 
39 #endif  /* _INC_STDARG */
40