Skip to content

Commit 8115042

Browse files
committed
add __THROW on _mi_assert_fail (GCC only)
1 parent d97221b commit 8115042

File tree

1 file changed

+7
-1
lines changed
  • Include/internal/mimalloc/mimalloc

1 file changed

+7
-1
lines changed

Include/internal/mimalloc/mimalloc/types.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,12 @@ terms of the MIT license. A copy of the license can be found in the file
6868
#else
6969
#define mi_decl_cold
7070
#endif
71+
72+
#if (defined(__GNUC__) && defined(__THROW))
73+
#define mi_decl_throw __THROW
74+
#else
75+
#define mi_decl_throw
76+
#endif
7177
#endif
7278

7379
// ------------------------------------------------------
@@ -602,7 +608,7 @@ struct mi_heap_s {
602608

603609
#if (MI_DEBUG)
604610
// use our own assertion to print without memory allocation
605-
mi_decl_noreturn mi_decl_cold
611+
mi_decl_noreturn mi_decl_cold mi_decl_throw
606612
void _mi_assert_fail(const char* assertion, const char* fname, unsigned int line, const char* func);
607613
#define mi_assert(expr) ((expr) ? (void)0 : _mi_assert_fail(#expr,__FILE__,__LINE__,__func__))
608614
#else

0 commit comments

Comments
 (0)