File: varargs.h

package info (click to toggle)
sendmail 8.18.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 12,268 kB
  • sloc: ansic: 106,906; perl: 7,504; sh: 5,488; makefile: 888
file content (50 lines) | stat: -rw-r--r-- 1,321 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
 * Copyright (c) 2000-2001 Proofpoint, Inc. and its suppliers.
 *	All rights reserved.
 *
 * By using this file, you agree to the terms and conditions set
 * forth in the LICENSE file which can be found at the top level of
 * the sendmail distribution.
 *
 *	$Id: varargs.h,v 1.9 2013-11-22 20:51:32 ca Exp $
 */

/*
**  libsm variable argument lists
*/

#ifndef SM_VARARGS_H
# define SM_VARARGS_H

# if defined(__STDC__) || defined(__cplusplus)
#  define SM_VA_STD 1
#  include <stdarg.h>
#  define SM_VA_START(ap, f)	va_start(ap, f)
# else /* defined(__STDC__) || defined(__cplusplus) */
#  define SM_VA_STD 0
#  include <varargs.h>
#  define SM_VA_START(ap, f)	va_start(ap)
# endif /* defined(__STDC__) || defined(__cplusplus) */

# if defined(va_copy)
#  define SM_VA_COPY(dst, src)	va_copy((dst), (src))
# elif defined(__va_copy)
#  define SM_VA_COPY(dst, src)	__va_copy((dst), (src))
# else
#  define SM_VA_COPY(dst, src)	memcpy(&(dst), &(src), sizeof((dst)))
#  define SM_VA_END_COPY(ap)	do { } while (0)
# endif

# ifndef SM_VA_END_COPY
#  define SM_VA_END_COPY(ap)	va_end(ap)
# endif

/*
**  The following macros are useless, but are provided for symmetry.
*/

# define SM_VA_LOCAL_DECL	va_list ap;
# define SM_VA_ARG(ap, type)	va_arg(ap, type)
# define SM_VA_END(ap)		va_end(ap)

#endif /* ! SM_VARARGS_H */