[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libmicrohttpd] MinGW: Compiler error with --enable-messages

From: Andre Colomb
Subject: [libmicrohttpd] MinGW: Compiler error with --enable-messages
Date: Mon, 18 May 2009 14:14:02 +0200
User-agent: Thunderbird (Windows/20090302)

Hi all,

I just tried to build MHD 0.4.2 under MinGW using GCC 3.4.5. There seems to be a problem when configuring with --enable-messages, which produces the following error message:

libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../.. -I../../src/include -I../../src/daemon -I../../src/daemon/https/lgl -I../../src/daemon/https/x509 -I../../src/daemon/https/minitasn1 -I../../src/daemon/https/tls -I../../src/daemon/https -I/z/src/mhd-build/pthreads/Pre-built.2/include -fno-strict-aliasing -Drandom=rand -MT daemon.lo -MD -MP -MF .deps/daemon.Tpo -c daemon.c -DDLL_EXPORT -DPIC -o .libs/daemon.o
daemon.c: In function `MHD_start_daemon_va':
daemon.c:1147: error: syntax error before ')' token
daemon.c:1160: error: syntax error before ')' token

In the referenced source lines, there is a call to
FPRINTF (stderr, "some message")
but on MinGW platforms, plibc.h defines the macro to
#define FPRINTF(fil, fmt, ...) _win_fprintf(fil, fmt, __VA_ARGS__)

I suppose there is a problem when no additional arguments are given, because the message format string doesn't need any. My solution is to just add a NULL pointer as the last argument to the macro call.

Maybe there is a more elegant / correct solution for this. In case it is a compiler issue, the plibc developers should probably take care of it. I attached a patch for my workaround.

--- src/daemon/daemon.c.orig    Thu Apr  2 01:47:04 2009
+++ src/daemon/daemon.c Mon May 18 11:57:02 2009
@@ -1145,7 +1145,7 @@
       FPRINTF (stderr,
-               "MHD thread pooling only works with 
+               "MHD thread pooling only works with 
       free (retVal);
       return NULL;
@@ -1157,7 +1157,7 @@
-      FPRINTF (stderr, "AF_INET6 not supported\n");
+      FPRINTF (stderr, "AF_INET6 not supported\n", NULL);
       return NULL;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]