Move declarations of xmpp_{v,}snprintf.
Use HAVE_SNPRINTF and HAVE_VSNPRINTF to conditionnaly use an internal version of these functions or use the libc one.
This commit is contained in:
committed by
Dmitry Podgorny
parent
60cfcc72e6
commit
a61dba0c13
34
src/snprintf.h
Normal file
34
src/snprintf.h
Normal file
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Copyright Patrick Powell 1995
|
||||
* This code is based on code written by Patrick Powell (papowell@astart.com)
|
||||
* It may be used for any purpose as long as this notice remains intact
|
||||
* on all source code distributions
|
||||
*/
|
||||
|
||||
/** @file
|
||||
* Compatibility wrappers for OSes lacking snprintf(3) and/or vsnprintf(3).
|
||||
*/
|
||||
|
||||
#ifndef __LIBSTROPHE_SNPRINTF_H__
|
||||
#define __LIBSTROPHE_SNPRINTF_H__
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#if defined(HAVE_SNPRINTF) || defined(HAVE_VSNPRINTF)
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SNPRINTF
|
||||
#define xmpp_snprintf snprintf
|
||||
#else
|
||||
int xmpp_snprintf(char *str, size_t count, const char *fmt, ...);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_VSNPRINTF
|
||||
#define xmpp_vsnprintf vsnprintf
|
||||
#else
|
||||
int xmpp_vsnprintf(char *str, size_t count, const char *fmt, va_list arg);
|
||||
#endif
|
||||
|
||||
#endif /* __LIBSTROPHE_SNPRINTF_H__ */
|
||||
Reference in New Issue
Block a user