<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
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>                                        </body>
</html>