Build fix for systems linux where va_list is an array type.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39508 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -958,15 +958,25 @@ int WXDLLEXPORT wxVsnprintf_(wxChar *buf, size_t lenMax,
|
|||||||
return -1; // format strings with both positional and
|
return -1; // format strings with both positional and
|
||||||
// non-positional conversion specifier are unsupported !!
|
// non-positional conversion specifier are unsupported !!
|
||||||
|
|
||||||
|
// on platforms where va_list is an array type, it is necessary to make a
|
||||||
|
// copy to be able to pass it to LoadArg as a reference.
|
||||||
|
bool ok = true;
|
||||||
|
va_list ap;
|
||||||
|
wxVaCopy(ap, argptr);
|
||||||
|
|
||||||
// now load arguments from stack
|
// now load arguments from stack
|
||||||
for (i=0; i < nargs; i++) {
|
for (i=0; i < nargs && ok; i++) {
|
||||||
if (!pspec[i])
|
// !pspec[i] if user forgot a positional parameter (e.g. %$1s %$3s) ?
|
||||||
return -1; // user forgot a positional parameter (e.g. %$1s %$3s) ?
|
// or LoadArg false if wxPrintfConvSpec::Parse failed to set its 'type'
|
||||||
if (!pspec[i]->LoadArg(&argdata[i], argptr))
|
// to a valid value...
|
||||||
return -1; // this means that wxPrintfConvSpec::Parse failed
|
ok = pspec[i] && pspec[i]->LoadArg(&argdata[i], ap);
|
||||||
// to set its 'type' to a valid value...
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
va_end(ap);
|
||||||
|
|
||||||
|
if (!ok)
|
||||||
|
return -1;
|
||||||
|
|
||||||
// finally, process each conversion specifier with its own argument
|
// finally, process each conversion specifier with its own argument
|
||||||
toparse = format;
|
toparse = format;
|
||||||
for (i=0; i < nargs; i++)
|
for (i=0; i < nargs; i++)
|
||||||
|
Reference in New Issue
Block a user