OSDN Git Service

最初のコミット
[winaudioj/stedx.git] / snprintf.h
1 #pragma once
2
3 #ifndef _PORTABLE_SNPRINTF_H_
4 #define _PORTABLE_SNPRINTF_H_
5
6 #define PORTABLE_SNPRINTF_VERSION_MAJOR 2
7 #define PORTABLE_SNPRINTF_VERSION_MINOR 2
8
9 #ifdef HAVE_SNPRINTF
10 #include <stdio.h>
11 #else
12  int snprintf(char *, size_t, const char *, /*args*/ ...);
13  int vsnprintf(char *, size_t, const char *, va_list);
14 #endif
15
16 #if defined(HAVE_SNPRINTF) && defined(PREFER_PORTABLE_SNPRINTF)
17  int portable_snprintf(char *str, size_t str_m, const char *fmt, /*args*/ ...);
18  int portable_vsnprintf(char *str, size_t str_m, const char *fmt, va_list ap);
19 #define snprintf  portable_snprintf
20 #define vsnprintf portable_vsnprintf
21 #endif
22
23  int asprintf  (char **ptr, const char *fmt, /*args*/ ...);
24  int vasprintf (char **ptr, const char *fmt, va_list ap);
25  int asnprintf (char **ptr, size_t str_m, const char *fmt, /*args*/ ...);
26  int vasnprintf(char **ptr, size_t str_m, const char *fmt, va_list ap);
27
28 #endif