Added detection of vsscanf and whether or not a prototype exists in headers.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52980 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Neis
2008-04-02 12:05:27 +00:00
parent 42013f4c28
commit a93cf225f7
5 changed files with 55 additions and 6 deletions

View File

@@ -19,8 +19,11 @@
#include "wx/wxcrtbase.h"
#include "wx/string.h"
#if defined (__VISUALC__) || defined (__DMC__)
#define HAVE_NO_VSSCANF 1
#ifndef __WX_SETUP_H__
// For non-configure builds assume vsscanf is available, if not Visual C or DMC
#if !defined (__VISUALC__) && !defined (__DMC__)
#define HAVE_VSSCANF 1
#endif
#endif
// ============================================================================

View File

@@ -31,8 +31,8 @@
/* printf() family saga */
/*
For some systems [v]snprintf() exists in the system libraries but not in the
headers, so we need to declare it ourselves to be able to use it.
For some systems [v]snprintf()/vsscanf() exists in the system libraries but
not in the headers, so we need to declare it ourselves to be able to use it.
*/
#if defined(HAVE_VSNPRINTF) && !defined(HAVE_VSNPRINTF_DECL)
#ifdef __cplusplus
@@ -52,6 +52,15 @@
int snprintf(char *str, size_t size, const char *format, ...);
#endif /* !HAVE_SNPRINTF_DECL */
#if defined(HAVE_VSSCANF) && !defined(HAVE_VSSCANF_DECL)
#ifdef __cplusplus
extern "C"
#else
extern
#endif
int vsscanf(const char *str, const char *format, va_list ap);
#endif /* !HAVE_SNPRINTF_DECL */
/* Wrapper for vsnprintf if it's 3rd parameter is non-const. Note: the
* same isn't done for snprintf below, the builtin wxSnprintf_ is used
* instead since it's already a simple wrapper */