[PATCH] testing/dispatch_test.c
Hi, to get a prototype for apsintf in order to compile testing/dispatch_test.c on Linux. ciao, Mario Index: testing/dispatch_test.c =================================================================== --- testing/dispatch_test.c (Revision 165) +++ testing/dispatch_test.c (Arbeitskopie) @@ -4,6 +4,19 @@ #include <sys/wait.h> #include <stdarg.h> + +#if defined(__linux__) + /* needed to get a prototype for asprintf */ + #define __USE_GNU + /* + * __USE_GNU also enables a prototype for fopencookie using the type + * _IO_cookie_io_functions_t which is only defined in libio.h + * included with _GNU_SOURCE defined + */ + #define _GNU_SOURCE + #include <libio.h> +#endif + #include <stdio.h> #include <stdlib.h> #include <unistd.h>
On Mon, 16 Nov 2009, Mario Schwalbe wrote:
to get a prototype for apsintf in order to compile testing/dispatch_test.c on Linux.
While I've never used it, configure appears to have a macro, AC_USE_SYSTEM_EXTENSIONS, one of which is _GNU_SOURCE. Could you investigate using this, or some similar configure-time decision about defining _GNU_SOURCE and possibly extra includes like libio.h. Robert N M Watson Computer Laboratory University of Cambridge
Hi, Robert Watson schrieb:
On Mon, 16 Nov 2009, Mario Schwalbe wrote:
to get a prototype for apsintf in order to compile testing/dispatch_test.c on Linux. While I've never used it, configure appears to have a macro, AC_USE_SYSTEM_EXTENSIONS, one of which is _GNU_SOURCE. Could you investigate using this, or some similar configure-time decision about defining _GNU_SOURCE and possibly extra includes like libio.h.
You're right. AC_USE_SYSTEM_EXTENSIONS seems to work as well. ciao, Mario Index: configure.ac =================================================================== --- configure.ac (Revision 166) +++ configure.ac (Arbeitskopie) @@ -110,6 +110,7 @@ [Define to use non-portablesemaphore optimizations for Mac OS X])] ) +AC_USE_SYSTEM_EXTENSIONS AC_PROG_CC AC_PROG_CXX AC_PROG_INSTALL
participants (2)
-
Mario Schwalbe
-
Robert Watson