~clint-fewbar/ubuntu/precise/squid3/ignore-sighup-early

« back to all changes in this revision

Viewing changes to include/snprintf.h

  • Committer: Bazaar Package Importer
  • Author(s): Luigi Gangitano
  • Date: 2006-11-11 10:32:06 UTC
  • Revision ID: james.westby@ubuntu.com-20061111103206-f3p0r9g0vq44rp3r
Tags: upstream-3.0.PRE5
ImportĀ upstreamĀ versionĀ 3.0.PRE5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * $Id: snprintf.h,v 1.7 2003/01/23 00:36:48 robertc Exp $
 
3
 */
 
4
 
 
5
#ifndef SQUID_SNPRINTF_H
 
6
#define SQUID_SNPRINTF_H
 
7
 
 
8
/* if you have configure you can use this */
 
9
#if defined(HAVE_CONFIG_H)
 
10
#include "config.h"
 
11
#endif
 
12
 
 
13
/* varargs declarations: */
 
14
/* you might have to hand force this by doing #define HAVE_STDARG_H */
 
15
 
 
16
#if defined(HAVE_STDARG_H)
 
17
#include <stdarg.h>
 
18
#define HAVE_STDARGS            /* let's hope that works everywhere (mj) */
 
19
#define VA_LOCAL_DECL va_list ap;
 
20
#define VA_START(f) va_start(ap, f)
 
21
#define VA_SHIFT(v,t) ;         /* no-op for ANSI */
 
22
#define VA_END va_end(ap)
 
23
#else
 
24
#if defined(HAVE_VARARGS_H)
 
25
#include <varargs.h>
 
26
#undef HAVE_STDARGS
 
27
#define VA_LOCAL_DECL va_list ap;
 
28
#define VA_START(f) va_start(ap)        /* f is ignored! */
 
29
#define VA_SHIFT(v,t) v = va_arg(ap,t)
 
30
#define VA_END va_end(ap)
 
31
#else
 
32
#error **NO VARARGS **
 
33
#endif
 
34
#endif
 
35
 
 
36
/* you can have ANSI C definitions */
 
37
 
 
38
#if !HAVE_SNPRINTF
 
39
#ifdef HAVE_STDARGS
 
40
int snprintf(char *str, size_t count, const char *fmt,...);
 
41
#else
 
42
int snprintf();
 
43
#endif
 
44
#endif
 
45
 
 
46
#if !HAVE_VSNPRINTF
 
47
#ifdef HAVE_STDARGS
 
48
int vsnprintf(char *str, size_t count, const char *fmt, va_list arg);
 
49
#else
 
50
int vsnprintf();
 
51
#endif
 
52
#endif
 
53
 
 
54
#endif /* SQUID_SNPRINTF_H */