1 /* ///////////////////////////////////////////////////////////////////////
2 * File: assert_failed.h
7 * Brief: assertion_failed handle function
10 * Copyright (c) 2008-2020, Waruqi All rights reserved.
11 * //////////////////////////////////////////////////////////////////// */
12 #ifndef EXTL_PLATFORM_WIN_UTILITY_ASSERT_FAILED_H
13 #define EXTL_PLATFORM_WIN_UTILITY_ASSERT_FAILED_H
15 /*!\file assert_failed.h
16 * \brief assertion_failed handle function
19 /* ///////////////////////////////////////////////////////////////////////
22 #include "../../config/config.h"
24 /* ///////////////////////////////////////////////////////////////////////
25 * ::extl::platform::win namespace
27 EXTL_WIN_BEGIN_WHOLE_NAMESPACE
29 /*!\brief assertion_failed handle function
30 * \ingroup extl_group_utility
32 #ifdef EXTL_INLINE_ASM_IN_INLINE_SUPPORT
37 void assertion_failed(e_uint_t const_ref nLine
, e_char_t
const *pszExpr
, e_char_t
const *pszFunc
, e_char_t
const *pszFile
)
39 e_char_t szMsg
[EXTL_ASSERT_MSG_SIZE_MAX
];
41 e_a_sprintf(szMsg
, "Code:%s\nLine:%d\nFunc:%s\nFile:%s\n\nDo you debug?",
42 pszExpr
, nLine
, pszFunc
, pszFile
);
44 e_int_t nRet
= MessageBoxA(NULL
, szMsg
, "Assert failure", MB_YESNO
);
47 #ifdef EXTL_INLINE_ASM_SUPPORT
53 TerminateProcess(GetCurrentProcess(),0);
57 /* ///////////////////////////////////////////////////////////////////////
58 * ::extl::platform::win namespace
60 EXTL_WIN_END_WHOLE_NAMESPACE
62 /* //////////////////////////////////////////////////////////////////// */
63 #endif /* EXTL_PLATFORM_WIN_UTILITY_ASSERT_FAILED_H */
64 /* //////////////////////////////////////////////////////////////////// */