RE: [AD] (v)sprintf vs (v)sNprintf

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Title: RE: [AD] (v)sprintf vs (v)sNprintf

> I would prefer that you put in all relevant places an explicit #ifdef
>
> #ifdef HAVE_SNPRINTF
> snprint(...)
> #else
> sprintf()
> #endif
>
> so that we can #define HAVE_SNPRINTF in the configuration
> header for each port
> that supports them.

Why not, rather, in a "portability" file:

#ifndef HAVE_SNPRINTF
size_t snprintf(char *str,size_t size,const char *format,...)
{
  /* left as an exercise for the reader ... */
}
#endif

And I'd rather not have plenty of ifdefs in the actual main source
if it can be avoided.

--
Vincent Penquerc'h



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/