ref: fe00017a06ddf9314ce79a83a60ae6333769bb24
parent: f014317fb10448e5f4b2f80eb819f6ffdf7815f5
author: Marcus Asteborg <maastebo@microsoft.com>
date: Sun Jun 7 17:16:12 EDT 2020
Disable message box when calling abort(). The message box is causing hangs in tests. Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
--- a/celt/arch.h
+++ b/celt/arch.h
@@ -73,6 +73,9 @@
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
--- a/silk/typedef.h
+++ b/silk/typedef.h
@@ -67,6 +67,9 @@
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);}}
--- a/tests/test_opus_common.h
+++ b/tests/test_opus_common.h
@@ -75,6 +75,9 @@
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__);