summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorPavel A <pavel.aronsky@daynix.com>2014-06-20 13:42:14 +0200
committerStef Walter <stef@thewalter.net>2014-06-20 13:42:14 +0200
commit4faa892e97e59dd6ab01b4cae3e2534663e18ba7 (patch)
tree1c24a345677b9eb46318f0e839129920ae31535a /common
parent98292d6bbc21168b517cdfca2635d35f2b47740d (diff)
Proposed fix for compiler warnings in common/compat.c
when buliding for Windows (mingw). This issue has been reported in bug #76594 a. Moved vasprintf before asprintf b. Added prototypes for each of them Thanks, pa Signed-off-by: Pavel A <pavel.aronsky@daynix.com>
Diffstat (limited to 'common')
-rw-r--r--common/compat.c42
1 files changed, 23 insertions, 19 deletions
diff --git a/common/compat.c b/common/compat.c
index f5b88ec..85a33c8 100644
--- a/common/compat.c
+++ b/common/compat.c
@@ -519,28 +519,11 @@ strconcat (const char *first,
#endif /* HAVE_STRCONCAT */
-#ifndef HAVE_ASPRINTF
-
-int
-asprintf (char **strp,
- const char *fmt,
- ...)
-{
- va_list va;
- int ret;
-
- va_start (va, fmt);
- ret = vasprintf (strp, fmt, va);
- va_end (va);
-
- return ret;
-}
-
-#endif /* HAVE_ASPRINTF */
-
#ifndef HAVE_VASPRINTF
#include <stdio.h>
+int vasprintf(char **strp, const char *fmt, va_list ap);
+
int
vasprintf (char **strp,
const char *fmt,
@@ -585,6 +568,27 @@ vasprintf (char **strp,
#endif /* HAVE_VASPRINTF */
+#ifndef HAVE_ASPRINTF
+
+int asprintf(char **strp, const char *fmt, ...);
+
+int
+asprintf (char **strp,
+ const char *fmt,
+ ...)
+{
+ va_list va;
+ int ret;
+
+ va_start (va, fmt);
+ ret = vasprintf (strp, fmt, va);
+ va_end (va);
+
+ return ret;
+}
+
+#endif /* HAVE_ASPRINTF */
+
#ifndef HAVE_GMTIME_R
struct tm *