<html><head><base href="x-msg://2232/"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">I think I was mistaken. It does appear to be turned on.<br>
<br><div><div>On Feb 8, 2011, at 9:06 AM, Jay K wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div class="hmmessage" style="font-size: 10pt; font-family: Tahoma; ">It was recently suspect that asserts aren't enabled in the C code in m3core.h<br>I don't think so. I think there might just be a missing check of a return value in m3core/thread/*.m3<br><br>However, if we want to dispell this fear now and forever, we could do e.g.:<br><br>m3core.h:<br><br>M3_DLL_LOCAL<br>void<br>__stdcall<br>M3C__AssertFailed (const char* file, unsigned line, const char* expression);<br><br>#define M3_ASSERT(expr) ((expr) ? ((void)0) ? M3C__AssertFailed ( \<br> __FILE__, __LINE__, #expression))<br><br><br><br>hand.c:<br><br>M3_DLL_LOCAL<br>void<br>__stdcall<br>M3C__AssertFailed (const char* file, unsigned line, const char* expression)<br>{<br> fprintf (stderr, "%s(%u): assertion failed: %s\n", file, line, expression);<br> abort ();<br>}<br><br>This might slightly reduce quality on some platforms, e.g.:<br><br>Assertion failed: (0), function main, file 1.c, line 2.<br>Abort trap<br>jbook2:libm3 jay$ cat 1.c<br>#include <assert.h><br>int main() { assert(0); return 0; }<br><br><br>that is -- see how it printed the file name? Anyway, we could get that back too, like<br>#if __GNUC__ > whatever<br> #define M3_FUNCTION something<br>#elif _MSC_VER > something<br> #define M3_FUNCTION __FUNCTION__<br>#else<br> #define M3_FUNCTION 0<br>#endif<br><br><br>?<br><br>But I think probably using standard assert is adequate or preferable.<br>We could #undef NDEBUG in m3core.h, in case someone added to the C compiler on the config files.<br>or #ifdef NDEBUG, #error.<br><br> - Jay<br><br></div></span></blockquote></div><br></body></html>