[Mesa-dev] [PATCH v5 5/8] mesa/main: don't use win _vsnprintf. there is 'util_vsnprintf' function
emil.l.velikov at gmail.com
Thu Sep 20 08:56:26 UTC 2018
On 7 September 2018 at 13:15, <asimiklit.work at gmail.com> wrote:
> From: Andrii Simiklit <andrii.simiklit at globallogic.com>
> The win '_vsnprintf' function incompatibility with C99 vsnprintf.
> At least for case when the input buffer size less than the required size:
> '_vsnprintf' returns -1 for this case.
> 'vsnprintf' returns the required size.
> v5: remove _mesa_*snprintf functions and replace it by util_*snprintf
> So use cross platform implementation 'util_vsnprintf'.
> Reviewed-by: Emil Velikov <emil.velikov at collabora.com>
> Fixes: 2353e96c320d "Coerce vsnprintf to _vsnprintf for windows"
> Signed-off-by: Andrii Simiklit <andrii.simiklit at globallogic.com>
A couple of trivial follow-up ideas. Just putting them out here - for
anyone interested to take a stab.
> +#if defined(__IBMC__) || defined(__IBMCPP__)
> +extern int vsnprintf(char *str, size_t count, const char *fmt, va_list arg);
This and the similar workaround for Cygwin could be dropped.
The fact that we had them in only one place (of 10+) indicates that
they are no longer needed.
> #define util_vsnprintf vsnprintf
> #define util_snprintf snprintf
> #define util_vsprintf vsprintf
Jose has bumped the MSVC requirement to 2015, which has proper
implementation of some *printf functions.
One could skim through the MSDN pages and drop the workarounds we no
More information about the mesa-dev