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