mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-23 18:32:55 +00:00
check for vsnprintf() during build
QT_SNPRINTF and QT_VSNPRINTF should not be used directly thus removing them Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
3d9d72dffd
commit
550185907b
3 changed files with 5 additions and 13 deletions
|
@ -365,6 +365,7 @@ katie_check_function(getgrgid_r "grp.h")
|
|||
katie_check_function(nl_langinfo "langinfo.h")
|
||||
katie_check_function(getaddrinfo "netdb.h")
|
||||
katie_check_function(clock_gettime "time.h")
|
||||
katie_check_function(vsnprintf "stdio.h")
|
||||
# XSI/POSIX.1-2001
|
||||
katie_check_function(strerror_r "string.h")
|
||||
# SUSv2
|
||||
|
|
|
@ -154,11 +154,6 @@
|
|||
#define QT_SOCKET_CONNECT ::connect
|
||||
#define QT_SOCKET_BIND ::bind
|
||||
|
||||
#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500)
|
||||
#define QT_SNPRINTF ::snprintf
|
||||
#define QT_VSNPRINTF ::vsnprintf
|
||||
#endif
|
||||
|
||||
#define QT_BUFFSIZE BUFSIZ
|
||||
|
||||
#endif // include guard
|
||||
|
|
|
@ -31,15 +31,11 @@
|
|||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "qplatformdefs.h"
|
||||
|
||||
#include "qbytearray.h"
|
||||
#include "qstring.h"
|
||||
|
||||
#include "string.h"
|
||||
#ifdef QT_VSNPRINTF
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
@ -67,7 +63,9 @@ QT_BEGIN_NAMESPACE
|
|||
|
||||
int qvsnprintf(char *str, size_t n, const char *fmt, va_list ap)
|
||||
{
|
||||
#ifndef QT_VSNPRINTF
|
||||
#ifdef QT_HAVE_VSNPRINTF
|
||||
return ::vsnprintf(str, n, fmt, ap);
|
||||
#else
|
||||
if (!str || !fmt)
|
||||
return -1;
|
||||
|
||||
|
@ -83,8 +81,6 @@ int qvsnprintf(char *str, size_t n, const char *fmt, va_list ap)
|
|||
}
|
||||
|
||||
return ba.length();
|
||||
#else
|
||||
return QT_VSNPRINTF(str, n, fmt, ap);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue