1
/**************************************************************************
3
(C) 2008 - 2011 Alexander Shaduri <ashaduri 'at' gmail.com>
4
License: See LICENSE_zlib.txt file
5
***************************************************************************/
7
/// \author Alexander Shaduri
12
#ifndef HZ_STRING_SPRINTF_MACROS_H
13
#define HZ_STRING_SPRINTF_MACROS_H
15
#include "hz_config.h" // feature macros
17
#include "system_specific.h" // HZ_FUNC_PRINTF_*_CHECK
20
// This is a helper file for string_sprintf.h. It is useful if you need
21
// the macros only, but not the implementation (useful for header files).
25
// HAVE_STRING_SPRINTF_MS - whether the MS (%I64d and %I64u)
26
// specifiers are supported.
28
// HAVE_STRING_SPRINTF_ISO - whether the ISO
29
// (%lld, %llu, %Lf) specifiers are supported.
31
#if defined ENABLE_GLIB && ENABLE_GLIB
32
#define HAVE_STRING_SPRINTF_MS 0
33
#define HAVE_STRING_SPRINTF_ISO 1
35
#elif defined HAVE_ISO_STDIO && HAVE_ISO_STDIO
36
// mingw/ISO has both the MS and ISO specifiers
37
#if defined _WIN32 && defined __GNUC__
38
#define HAVE_STRING_SPRINTF_MS 1
40
#define HAVE_STRING_SPRINTF_MS 0
42
#define HAVE_STRING_SPRINTF_ISO 1
44
#elif defined HAVE_WIN_SE_FUNCS && HAVE_WIN_SE_FUNCS
45
#define HAVE_STRING_SPRINTF_MS 1
46
#define HAVE_STRING_SPRINTF_ISO 0
48
#elif defined HAVE__VSNPRINTF && HAVE__VSNPRINTF
49
#define HAVE_STRING_SPRINTF_MS 0
50
#define HAVE_STRING_SPRINTF_ISO 1
53
#warning Cannot detect vsnprintf() availability
55
#define HAVE_STRING_SPRINTF_MS 0
56
#define HAVE_STRING_SPRINTF_ISO 0
62
// HZ_FUNC_STRING_SPRINTF_CHECK - gcc printf format attribute checker,
63
// configured according to MS or ISO features (prefers ISO over MS).
65
#if HAVE_STRING_SPRINTF_ISO
66
#define HZ_FUNC_STRING_SPRINTF_CHECK(format_idx, check_idx) HZ_FUNC_PRINTF_ISO_CHECK(format_idx, check_idx)
67
#elif HAVE_STRING_SPRINTF_MS
68
#define HZ_FUNC_STRING_SPRINTF_CHECK(format_idx, check_idx) HZ_FUNC_PRINTF_MS_CHECK(format_idx, check_idx)
70
#define HZ_FUNC_STRING_SPRINTF_CHECK(format_idx, check_idx)