From: Stephen T. <st...@sb...> - 2003-03-20 19:48:15
|
On Thu, 2003-03-20 at 13:25, Heiko Schaefer wrote: > maybe it would make sense just to leave the asserts in ffmpeg's code as > they originally were ? >=20 > Stephen: why did you change them ?! An attempt at being a bit more informative than "assert(x!=3D0)". > if there was a real reason to change them, something like a XINE_WARN or > any sort of debugging output mechanism would probably be a better > replacement. How about this? Its the XINE_ASSERT code minus the abort(). I do not know if on a warning it would be informative to give a backtrace. /** * Provide assert like feature with better description of failure * Thanks to Mark Thomas */ #ifndef NDEBUG # if __GNUC__ # define XINE_WARNING(exp, desc, args...) \ do { \ if (!(exp)) { \ printf("%s:%s:%d: assertion `%s' failed. " desc "\n\n", \ __FILE__, __XINE_FUNCTION__, __LINE__, #exp, ##args); \ xine_print_trace(); \ } \ } while(0) # else /* not GNU C, assume we have a C99 compiler */ # define XINE_WARNING(exp...) \ do { \ if (!(exp)) { \ printf("%s:%s:%d: assertion `%s' failed. ", \ __FILE__, __XINE_FUNCTION__, __LINE__, #exp); \ printf(__VA_ARGS__); \ printf("\n\n"); \ xine_print_trace(); \ } \ } while(0) # endif #else # define XINE_WARNING(...) /**/ Stephen --=20 Stephen Torri <st...@sb...> |