[cairo] [PATCH 3/4] test: Only use alarm() when SIGALRM is also defined
mkbosmans at gmail.com
Tue Apr 10 11:26:11 PDT 2012
2012/4/10 Uli Schlachter <psychon at znc.in>:
> On 09.04.2012 21:33, Maarten Bosmans wrote:
>> On some platforms (mingw) the alarm() configure check succeeds, but the
>> alarm function doesn't actually work.
>> test/cairo-test.c | 2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>> diff --git a/test/cairo-test.c b/test/cairo-test.c
>> index c5ef843..3f37147 100644
>> --- a/test/cairo-test.c
>> +++ b/test/cairo-test.c
>> @@ -90,7 +90,7 @@
>> #define ARRAY_SIZE(A) (sizeof(A) / sizeof (A))
>> -#if ! HAVE_ALARM
>> +#if ! HAVE_ALARM || ! defined(SIGALRM)
>> #define alarm(X);
> What exactly does "doesn't actually work" mean? If no SIGALRM is raised (in
> other words: alarm() doesn't actually work and is a no-op), then what is the
> problem that this patch solves?
I'm cross-compiling for win32. Somehow the
configure check finds the alarm function and defines HAVE_ALARM, but
compilation of cairo-test.c fails with:
cairo-test.c: In function 'cairo_test_for_target':
cairo-test.c:922:5: error: implicit declaration of function 'alarm'
cairo-test.c:922:5: warning: nested extern declaration of 'alarm'
So perhaps the configure check should be tweaked, but as I have no
clue about the real origin of the problem, I though my solution was a
nice workaround. As Chris pointed out, even in without considering
this bug, it is not unreasonable to do.
More information about the cairo