remove \r
[extl.git] / extl / win / utility / assert_failed.h
blob1061784baa5ae66db83f41d2d53cde0272e89efa
1 /* ///////////////////////////////////////////////////////////////////////
2 * File: assert_failed.h
4 * Created: 08.02.07
5 * Updated: 08.05.05
7 * Brief: assertion_failed handle function
9 * [<Home>]
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 /* ///////////////////////////////////////////////////////////////////////
20 * Includes
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
33 EXTL_INLINE
34 #else
35 static
36 #endif
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);
45 if(nRet == IDYES)
47 #ifdef EXTL_INLINE_ASM_SUPPORT
48 __asm int 3
49 #endif
51 else
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 /* //////////////////////////////////////////////////////////////////// */