Work around wrong vsscanf() declaration under HP-UX.

Under this system vsscanf() is declared as taking a non-const char* as first
argument which prevented our code using it from compiling. Wrap it in
wxCRT_VsscanfA() adding the necessary const_cast<> to fix this.

Closes #15638.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75340 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2013-12-03 13:38:35 +00:00
parent 3258c423b4
commit 50805a002a
5 changed files with 98 additions and 1 deletions

View File

@@ -238,7 +238,17 @@
#define wxCRT_ScanfA scanf
#define wxCRT_SscanfA sscanf
#define wxCRT_FscanfA fscanf
#define wxCRT_VsscanfA vsscanf
/* vsscanf() may have a wrong declaration with non-const first parameter, fix
* this by wrapping it if necessary. */
#if defined __cplusplus && defined HAVE_BROKEN_VSSCANF_DECL
inline int wxCRT_VsscanfA(const char *str, const char *format, va_list ap)
{
return vsscanf(const_cast<char *>(str), format, ap);
}
#else
#define wxCRT_VsscanfA vsscanf
#endif
#if defined(wxNEED_WPRINTF)
int wxCRT_ScanfW(const wchar_t *format, ...);