32#ifdef _RWSTD_NO_VSNPRINTF
33# if !defined (_MSC_VER)
35extern "C" int vsnprintf (
char*,
size_t,
const char*, va_list);
39extern "C" int _vsnprintf (
char*,
size_t,
const char*, va_list);
41# define vsnprintf _vsnprintf
53 const int ret = vsnprintf (
buf,
size, fmat, va);
63 char buf [] =
"0123456789";
65 const char data [] =
"abcdef";
67 const size_t bufsize = success ?
sizeof buf : 4U;
68 const size_t datasize =
sizeof data;
82 if (datasize - 1 == ret) {
86 else if (datasize == ret) {
87 printf (
"#define _RWSTD_NO_VSNPRINTF_NUL "
88 "/* return value includes NUL on success */\n");
92 printf (
"#define _RWSTD_NO_VSNPRINTF_POS "
93 "/* return value negative on success */\n");
97 printf (
"#define _RWSTD_NO_VSNPRINTF_VALID "
98 "/* return value bogus on success */\n");
103 if (datasize - 1 == ret) {
109 printf (
"#define _RWSTD_NO_VSNPRINTF_VFLOW_VALID "
110 "/* return value negative on overflow */\n");
117 printf (
"#define _RWSTD_NO_VSNPRINTF_VFLOW_VALID "
118 "/* returns the number of non-NUL bytes written */\n");
122 printf (
"#define _RWSTD_NO_VSNPRINTF_VFLOW_VALID "
123 "/* returns the number of bytes written */\n");
127 printf (
"#define _RWSTD_NO_VSNPRINTF_VFLOW_VALID "
128 "/* return value bogus on overflow */\n");
IMPORT_C SInt32 printf(const Char *,...)
int my_snprintf(char *buf, size_t size, const char *fmat,...)
int test_vsnprintf(int success)
#define va_start(va, name)