www.digitalmars.com         C & C++   DMDScript  

D - vsnprintf aliases

reply Brian Hammond <d at brianhammond dot com> <Brian_member pathlink.com> writes:
Hi -

Looking through phobos' std.c.stdio I see the following:

version (Win32)
{
// ... snip ...
int  _vsnprintf(char *,size_t,char *,va_list);
}
version (GNU)
{
// ... snip ...
alias gcc.config.Cvsnprintf vsnprintf;
alias gcc.config.Cvsnprintf _vsnprintf;
}
else version (linux)
{
// ... snip ...
int  vsnprintf(char *,size_t,char *,va_list);
}

Shouldn't the linux version have:

alias _vsnprintf vsnprintf

and the windows version have:

alias vsnprintf _vsnprintf

or something more consistent like one virtual vsnprintf that maps to the correct
version (e.g. to _vsnprintf on windows)?  

Perhaps I am missing something.

Thanks!
Brian
Apr 08 2004
parent Brian Hammond <d at brianhammond dot com> <Brian_member pathlink.com> writes:
Nevermind - I see that the vsnprintf variations must be used differently from
one another.  phobos' std.outbuffer shows how to use all the vsnprintf versions
out there.  BTW the aliases I proposed were of course backwards.  Back to my
cave...

-Brian

In article <c5439s$1s80$1 digitaldaemon.com>, Brian Hammond <d at brianhammond
dot com> says...
Hi -

Looking through phobos' std.c.stdio I see the following:

version (Win32)
{
// ... snip ...
int  _vsnprintf(char *,size_t,char *,va_list);
}
version (GNU)
{
// ... snip ...
alias gcc.config.Cvsnprintf vsnprintf;
alias gcc.config.Cvsnprintf _vsnprintf;
}
else version (linux)
{
// ... snip ...
int  vsnprintf(char *,size_t,char *,va_list);
}

Shouldn't the linux version have:

alias _vsnprintf vsnprintf

and the windows version have:

alias vsnprintf _vsnprintf

or something more consistent like one virtual vsnprintf that maps to the correct
version (e.g. to _vsnprintf on windows)?  

Perhaps I am missing something.

Thanks!
Brian
Apr 08 2004