Am 05.01.2011 14:21, schrieb Samuli Seppänen:
> This fixes a generic Windows/VC++ issue:
>
> <http://thedailyreviewer.com/dotnet/view/strncasecmp-and-snprintf-functions-not-available-in-vc-109235975>
>
> Does this change affect the automake/gcc-based Windows builds?

NAK. Do not mess with the namespaces.

The whole mysnprintf macro looks suspicious and should be removed, as it
only works on static buffers. If you ever use it on dynamic buffers
(char *foo = malloc(4711); style), you're in for nasty surprises with
truncated strings -- and surprise means "prone to give maintenance head
aches".


If you must do it, use #ifdefs so it's only visible on Windows. The
canonical solution is to use AC_REPLACE([somefunction]) in
configure.{ac,in} and provide somefunction.c to contain a replacement
based on such boilerplate code:

#ifdef HAVE_CONFIG_H
#include "config.h"

#ifndef HAVE_SOMEFUNCTION
returntype somefunction( ...prototype... )
{
/* implementation */
}
#endif
#endif


The implementation can then be something along the lines of
arke_snprintf on
<http://social.msdn.microsoft.com/forums/en-US/vcgeneral/thread/2b339bdf-7ab1-4a08-bf7e-e9293801455b/>
but I'm not so sure about the license.

HTH

Reply via email to