Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:30:28

0001 #ifndef BOOST_CORE_DETAIL_LWT_UNATTENDED_HPP_INCLUDED
0002 #define BOOST_CORE_DETAIL_LWT_UNATTENDED_HPP_INCLUDED
0003 
0004 // Copyright 2014, 2022 Peter Dimov
0005 // Distributed under the Boost Software License, Version 1.0.
0006 // https://www.boost.org/LICENSE_1_0.txt
0007 
0008 #include <cstdlib>
0009 #if defined(_MSC_VER) && defined(_CPPLIB_VER) && defined(_DEBUG)
0010 # include <crtdbg.h>
0011 #endif
0012 
0013 namespace boost
0014 {
0015 namespace core
0016 {
0017 namespace detail
0018 {
0019 
0020 // Setup unattended mode by disabling interactive popups on
0021 // assertion failures
0022 
0023 inline void lwt_unattended()
0024 {
0025 #if defined(_MSC_VER) && (_MSC_VER > 1310)
0026 
0027     // disable message boxes on assert(), abort()
0028     ::_set_abort_behavior( 0, _WRITE_ABORT_MSG | _CALL_REPORTFAULT );
0029 
0030 # pragma warning(push)
0031 # pragma warning(disable: 4996)
0032 
0033 # if defined(__clang__)
0034 #  pragma clang diagnostic push
0035 #  pragma clang diagnostic ignored "-Wdeprecated-declarations"
0036 # endif
0037 
0038 #if !defined(WINAPI_FAMILY) || WINAPI_FAMILY == 100 /*WINAPI_FAMILY_DESKTOP_APP*/
0039 
0040     // disable message box on crash
0041     ::_seterrormode( /*SEM_NOGPFAULTERRORBOX*/ 0x0002 );
0042 
0043 #endif
0044 
0045 # if defined(__clang__)
0046 #  pragma clang diagnostic pop
0047 # endif
0048 
0049 # pragma warning(pop)
0050 
0051 #endif
0052 
0053 #if defined(_MSC_VER) && defined(_CPPLIB_VER) && defined(_DEBUG)
0054 
0055     // disable message boxes on iterator debugging violations
0056     _CrtSetReportMode( _CRT_ASSERT, _CRTDBG_MODE_FILE );
0057     _CrtSetReportFile( _CRT_ASSERT, _CRTDBG_FILE_STDERR );
0058 
0059 #endif
0060 }
0061 
0062 } // namespace detail
0063 } // namespace core
0064 } // namespace boost
0065 
0066 #endif // #ifndef BOOST_CORE_DETAIL_LWT_UNATTENDED_HPP_INCLUDED