[ODE] auto-disable patch (yet again)

Jon Watte hplus-ode at mindcontrol.org
Thu Apr 22 12:07:17 MST 2004


> And in the Windows version of dError and dDebug (in error.cpp), you'll 
> want to put an underscore in front of snprintf and vsnprintf.

> Apparently MS doesn't think those functions should be standard.


They aren't part of the C standard they're implementing, so arguably, 
polluting the global name space is bad. The name space starting with 
a single leading underscore belongs to the library implementation, so 
the way they did it has logical credence.

Also, the implementation they chose was to fill the buffer to the end 
and NOT zero-terminate if there isn't enough space. In that case, 
they return -1, rather than buffer size. I find this to be less useful 
than the GLIBC variation, and you'd probably want to wrap the _ 
versions in an inline which removes the "_" and which always zero-
terminates the output buffer, conditional compiled on WIN32 (assuming 
all WIN32 compilers use the same standard C library, else _MSC_VER).

Cheers,

			/ h+




More information about the ODE mailing list