From c533758bc66da675091cfcd11041c79135d2c2d2 Mon Sep 17 00:00:00 2001 From: "roc+@cs.cmu.edu" Date: Wed, 13 Jun 2007 15:10:23 -0700 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