Ethereal-cvs: Re: [ethereal-cvs] cvs commit: ethereal proto.c

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Guy Harris <gharris@xxxxxxxxxxxx>
Date: Thu, 10 Aug 2000 20:17:21 -0700
On Thu, Aug 10, 2000 at 10:03:10PM +0200, Laurent Deniel wrote:
> 2) if a service (i.e. snprintf) can not be used without including
>    some other header files, why not simply add 
> 
> # ifdef HAVE_STDARG_H
> #  include <stdarg.h>
> # else
> #  include <varargs.h>
> # endif
> 
> in our snprintf.h file ?

As long as <stdarg.h> and <varargs.h> are idempotent, that's fine; code
that calls "snprintf()" should also include <stdio.h> to get it declared
on systems that come with "snprintf()", and <stdio.h> may also include
<stdarg.h> (or <varargs.h>) so that "v*printf()" can be declared, and
code may also include them directly if it uses varargs stuff itself.