xref: /titanic_51/usr/src/cmd/sendmail/include/sm/varargs.h (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
1 /*
2  * Copyright (c) 2000-2001 Sendmail, Inc. and its suppliers.
3  *	All rights reserved.
4  *
5  * By using this file, you agree to the terms and conditions set
6  * forth in the LICENSE file which can be found at the top level of
7  * the sendmail distribution.
8  *
9  *	$Id: varargs.h,v 1.7.2.1 2002/07/29 21:43:20 gshapiro Exp $
10  */
11 
12 #pragma ident	"%Z%%M%	%I%	%E% SMI"
13 
14 /*
15 **  libsm variable argument lists
16 */
17 
18 #ifndef SM_VARARGS_H
19 # define SM_VARARGS_H
20 
21 # if defined(__STDC__) || defined(__cplusplus)
22 #  define SM_VA_STD 1
23 #  include <stdarg.h>
24 #  define SM_VA_START(ap, f)	va_start(ap, f)
25 # else /* defined(__STDC__) || defined(__cplusplus) */
26 #  define SM_VA_STD 0
27 #  include <varargs.h>
28 #  define SM_VA_START(ap, f)	va_start(ap)
29 # endif /* defined(__STDC__) || defined(__cplusplus) */
30 
31 # if defined(va_copy)
32 #  define SM_VA_COPY(dst, src)	va_copy((dst), (src))
33 # elif defined(__va_copy)
34 #  define SM_VA_COPY(dst, src)	__va_copy((dst), (src))
35 # else
36 #  define SM_VA_COPY(dst, src)	memcpy(&(dst), &(src), sizeof((dst)))
37 # endif
38 
39 /*
40 **  The following macros are useless, but are provided for symmetry.
41 */
42 
43 # define SM_VA_LOCAL_DECL	va_list ap;
44 # define SM_VA_ARG(ap, type)	va_arg(ap, type)
45 # define SM_VA_END(ap)		va_end(ap)
46 
47 #endif /* ! SM_VARARGS_H */
48