Disable message box when calling abort(). The message box is causing hangs in tests.

Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
This commit is contained in:
Marcus Asteborg 2020-06-07 21:16:12 -07:00 committed by Jean-Marc Valin
parent f014317fb1
commit fe00017a06
No known key found for this signature in database
GPG key ID: 5E5DD9A36F9189C8
3 changed files with 9 additions and 0 deletions

View file

@ -73,6 +73,9 @@ __attribute__((noreturn))
void celt_fatal(const char *str, const char *file, int line)
{
fprintf (stderr, "Fatal (internal) error in %s, line %d: %s\n", file, line, str);
#if defined(_MSC_VER)
_set_abort_behavior( 0, _WRITE_ABORT_MSG);
#endif
abort();
}
#endif

View file

@ -67,6 +67,9 @@ __attribute__((noreturn))
static OPUS_INLINE void _silk_fatal(const char *str, const char *file, int line)
{
fprintf (stderr, "Fatal (internal) error in %s, line %d: %s\n", file, line, str);
#if defined(_MSC_VER)
_set_abort_behavior( 0, _WRITE_ABORT_MSG);
#endif
abort();
}
# define silk_assert(COND) {if (!(COND)) {silk_fatal("assertion failed: " #COND);}}

View file

@ -75,6 +75,9 @@ static OPUS_INLINE void _test_failed(const char *file, int line)
fprintf(stderr,"Please report this failure and include\n");
fprintf(stderr,"'make check SEED=%u fails %s at line %d for %s'\n",iseed,file,line,opus_get_version_string());
fprintf(stderr,"and any relevant details about your system.\n\n");
#if defined(_MSC_VER)
_set_abort_behavior( 0, _WRITE_ABORT_MSG);
#endif
abort();
}
#define test_failed() _test_failed(__FILE__, __LINE__);