From 885b2252d5040bb5d7e37c1cd9627b6e04e4ae8b Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Fri, 10 Oct 2008 22:24:01 +0100 Subject: [PATCH] [test] Use _POSIX_C_SOURCE for flockfile. From bug 18010 (https://bugs.freedesktop.org/show_bug.cgi?id=18010), in order to make flockfile() available we need to set _POSIX_C_SOURCE and according to the man page, the appropriate feature check is _POSIX_THREAD_SAFE_FUNCTIONS. --- test/cairo-test.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/test/cairo-test.c b/test/cairo-test.c index 0e076c6..7edb4fb 100644 --- a/test/cairo-test.c +++ b/test/cairo-test.c @@ -24,6 +24,7 @@ */ #define _GNU_SOURCE 1 /* for feenableexcept() et al */ +#define _POSIX_C_SOURCE 2000112L /* for flockfile() et al */ #if HAVE_CONFIG_H #include "config.h" @@ -1059,7 +1060,7 @@ cairo_test_run (cairo_test_context_t *ctx) } fflush (stdout); } else { -#ifdef HAVE_FLOCKFILE +#if _POSIX_THREAD_SAFE_FUNCTIONS flockfile (stdout); #endif printf ("%s-%s-%s %d [%d]:\t", @@ -1090,7 +1091,7 @@ cairo_test_run (cairo_test_context_t *ctx) } fflush (stdout); -#ifdef HAVE_FLOCKFILE +#if _POSIX_THREAD_SAFE_FUNCTIONS funlockfile (stdout); #endif } -- 1.5.6.3