[cairo-commit] 2 commits - configure.in src/cairo-png.c
test/cairo-test.c
Behdad Esfahbod
behdad at kemper.freedesktop.org
Thu Aug 17 19:04:40 PDT 2006
configure.in | 2 +-
src/cairo-png.c | 2 +-
test/cairo-test.c | 10 ++++++++++
3 files changed, 12 insertions(+), 2 deletions(-)
New commits:
diff-tree 6f8cf53b1e1ccdbe1ab6a275656b19c6e5120e40 (from 474daa449325850b6427fb0d3fe511ca6d7c12ac)
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Thu Aug 17 22:02:02 2006 -0400
[test] Don't use signals if signal.h is not available
diff --git a/configure.in b/configure.in
index 25ea5fc..6bc226e 100644
--- a/configure.in
+++ b/configure.in
@@ -531,7 +531,7 @@ AC_CACHE_SAVE
dnl ===========================================================================
dnl Checks for precise integer types
-AC_CHECK_HEADERS([stdint.h inttypes.h sys/int_types.h])
+AC_CHECK_HEADERS([stdint.h signal.h inttypes.h sys/int_types.h])
AC_CHECK_TYPES([uint64_t, uint128_t])
AC_DEFUN([CAIRO_CC_TRY_FLAG], [
diff --git a/test/cairo-test.c b/test/cairo-test.c
index 2fd6508..bf52f8a 100644
--- a/test/cairo-test.c
+++ b/test/cairo-test.c
@@ -32,7 +32,9 @@
#include <stdarg.h>
#include <ctype.h>
#include <setjmp.h>
+#ifdef HAVE_SIGNAL_H
#include <signal.h>
+#endif
#include <assert.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
@@ -1698,11 +1700,13 @@ UNWIND_STRINGS:
return ret;
}
+#ifdef HAVE_SIGNAL_H
static void
segfault_handler (int signal)
{
longjmp (jmpbuf, signal);
}
+#endif
static cairo_test_status_t
cairo_test_expecting (cairo_test_t *test,
@@ -1713,7 +1717,9 @@ cairo_test_expecting (cairo_test_t *test
volatile size_t i, j, num_targets;
volatile cairo_bool_t limited_targets = FALSE, print_fail_on_stdout = TRUE;
const char *tname;
+#ifdef HAVE_SIGNAL_H
void (*old_segfault_handler)(int);
+#endif
volatile cairo_test_status_t status, ret;
cairo_test_target_t ** volatile targets_to_test;
cairo_test_target_t targets[] =
@@ -1930,13 +1936,17 @@ cairo_test_expecting (cairo_test_t *test
_cairo_test_content_name (target->content),
dev_offset);
+#ifdef HAVE_SIGNAL_H
/* Set up a checkpoint to get back to in case of segfaults. */
old_segfault_handler = signal (SIGSEGV, segfault_handler);
if (0 == setjmp (jmpbuf))
+#endif
status = cairo_test_for_target (test, target, dev_offset);
+#ifdef HAVE_SIGNAL_H
else
status = CAIRO_TEST_CRASHED;
signal (SIGSEGV, old_segfault_handler);
+#endif
cairo_test_log ("TEST: %s TARGET: %s FORMAT: %s OFFSET: %d RESULT: ",
test->name, target->name,
diff-tree 474daa449325850b6427fb0d3fe511ca6d7c12ac (from da1019c9138695cb838a54f8b871bbfd0e8996d7)
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Thu Aug 17 22:01:33 2006 -0400
[PNG] Include png.h after cairoint.h to avoid macro problems (bug 7744)
diff --git a/src/cairo-png.c b/src/cairo-png.c
index 63966b5..0ddfa62 100644
--- a/src/cairo-png.c
+++ b/src/cairo-png.c
@@ -35,9 +35,9 @@
* Kristian Høgsberg <krh at redhat.com>
*/
-#include <png.h>
#include <errno.h>
#include "cairoint.h"
+#include <png.h>
/* Unpremultiplies data and converts native endian ARGB => RGBA bytes */
static void
More information about the cairo-commit
mailing list