aboutsummaryrefslogtreecommitdiff
path: root/lib/mprintf.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2004-11-02 10:12:22 +0000
committerDaniel Stenberg <daniel@haxx.se>2004-11-02 10:12:22 +0000
commit24d47a6e07304cf0921f2d30734b3c64360773c3 (patch)
tree03bae425fc10d6c083e866a3e1ab5bf620dffe42 /lib/mprintf.c
parent8a66584db4ab3bd1668a685785da7108f7550e95 (diff)
Paul Nolan fix to make libcurl build nicely on Windows CE
Diffstat (limited to 'lib/mprintf.c')
-rw-r--r--lib/mprintf.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/lib/mprintf.c b/lib/mprintf.c
index 9135a1308..629a9e07c 100644
--- a/lib/mprintf.c
+++ b/lib/mprintf.c
@@ -40,6 +40,12 @@
#include <curl/mprintf.h>
+#ifdef _WIN32_WCE
+#define CURL_CDECL __cdecl
+#else
+#define CURL_CDECL
+#endif
+
#ifndef SIZEOF_LONG_DOUBLE
#define SIZEOF_LONG_DOUBLE 0
#endif
@@ -583,7 +589,12 @@ static int dprintf_formatf(
void *data, /* untouched by format(), just sent to the stream() function in
the second argument */
/* function pointer called for each output character */
+
+#if _WIN32_WCE
+ int (__cdecl *stream) (int, FILE *),
+#else
int (*stream)(int, FILE *),
+#endif
const char *format, /* %-formatted string */
va_list ap_save) /* list of parameters */
{
@@ -979,7 +990,7 @@ static int dprintf_formatf(
}
/* fputc() look-alike */
-static int addbyter(int output, FILE *data)
+static int CURL_CDECL addbyter(int output, FILE *data)
{
struct nsprintf *infop=(struct nsprintf *)data;
unsigned char outc = (unsigned char)output;
@@ -1027,7 +1038,7 @@ int curl_msnprintf(char *buffer, size_t maxlength, const char *format, ...)
}
/* fputc() look-alike */
-static int alloc_addbyter(int output, FILE *data)
+static int CURL_CDECL alloc_addbyter(int output, FILE *data)
{
struct asprintf *infop=(struct asprintf *)data;
unsigned char outc = (unsigned char)output;
@@ -1113,7 +1124,7 @@ char *curl_mvaprintf(const char *format, va_list ap_save)
return strdup("");
}
-static int storebuffer(int output, FILE *data)
+static int CURL_CDECL storebuffer(int output, FILE *data)
{
char **buffer = (char **)data;
unsigned char outc = (unsigned char)output;
@@ -1142,6 +1153,7 @@ int curl_mprintf(const char *format, ...)
int retcode;
va_list ap_save; /* argument pointer */
va_start(ap_save, format);
+
retcode = dprintf_formatf(stdout, fputc, format, ap_save);
va_end(ap_save);
return retcode;