From 1fa25111c4cf03243479dbfe5ff2613b27c93f4e Mon Sep 17 00:00:00 2001 From: "roc+%cs.cmu.edu" Date: Wed, 13 Jun 2007 22:10:23 +0000 Subject: [PATCH] Bug 382741. Make cairo asserts non-fatal. May fix tinderbox issues with crashing with new-textframe. r=vlad --- gfx/cairo/cairo/src/cairoint.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gfx/cairo/cairo/src/cairoint.h b/gfx/cairo/cairo/src/cairoint.h index d50a7892e72..895515ab14b 100644 --- a/gfx/cairo/cairo/src/cairoint.h +++ b/gfx/cairo/cairo/src/cairoint.h @@ -240,6 +240,13 @@ typedef void *cairo_mutex_t; #endif #ifndef MOZILLA_CAIRO_NOT_DEFINED +/* Make assertions non-fatal */ +#ifndef NDEBUG +#undef assert +#define assert(expr) \ + do { if (!(expr)) fprintf(stderr, "Assertion failed at %s:%d: %s\n", \ + __FILE__, __LINE__, #expr); } while (0) +#endif #ifndef INT32_MAX # ifdef INT_MAX # define INT32_MAX INT_MAX