summaryrefslogtreecommitdiffstats
path: root/src/util/u_string.h
diff options
context:
space:
mode:
authorEric Engestrom <[email protected]>2018-11-20 12:02:36 +0000
committerEric Engestrom <[email protected]>2019-07-19 22:39:38 +0100
commit085c3abf27082f72978e011a652a5ece2f518099 (patch)
treef63e16e1a9f3777520ff8f1adf5d49d715f08f3b /src/util/u_string.h
parentdffeaa55dd1155d7a1e8feb5ecfc54fff688fcd8 (diff)
util: use standard name for vsnprintf()
Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/util/u_string.h')
-rw-r--r--src/util/u_string.h13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/util/u_string.h b/src/util/u_string.h
index 456de63d288..055d769fe13 100644
--- a/src/util/u_string.h
+++ b/src/util/u_string.h
@@ -65,6 +65,7 @@ util_strchrnul(const char *s, char c)
#ifdef _WIN32
+#define vsnprintf util_vsnprintf
static inline int
util_vsnprintf(char *str, size_t size, const char *format, va_list ap)
{
@@ -90,7 +91,7 @@ util_snprintf(char *str, size_t size, const char *format, ...)
va_list ap;
int ret;
va_start(ap, format);
- ret = util_vsnprintf(str, size, format, ap);
+ ret = vsnprintf(str, size, format, ap);
va_end(ap);
return ret;
}
@@ -102,7 +103,7 @@ util_sprintf(char *str, const char *format, ...)
{
va_list ap;
va_start(ap, format);
- util_vsnprintf(str, (size_t)-1, format, ap);
+ vsnprintf(str, (size_t)-1, format, ap);
va_end(ap);
}
@@ -114,7 +115,7 @@ util_vasprintf(char **ret, const char *format, va_list ap)
/* Compute length of output string first */
va_copy(ap_copy, ap);
- int r = util_vsnprintf(NULL, 0, format, ap_copy);
+ int r = vsnprintf(NULL, 0, format, ap_copy);
va_end(ap_copy);
if (r < 0)
@@ -125,7 +126,7 @@ util_vasprintf(char **ret, const char *format, va_list ap)
return -1;
/* Print to buffer */
- return util_vsnprintf(*ret, r + 1, format, ap);
+ return vsnprintf(*ret, r + 1, format, ap);
}
#define strncat util_strncat
@@ -182,10 +183,6 @@ util_strncmp(const char *s1, const char *s2, size_t n)
#define strcasecmp stricmp
#define strdup _strdup
-#else
-
-#define util_vsnprintf vsnprintf
-
#endif