1 #ifndef BOOST_CORE_QUICK_EXIT_HPP_INCLUDED 2 #define BOOST_CORE_QUICK_EXIT_HPP_INCLUDED 3 4 // MS compatible compilers support #pragma once 5 6 #if defined(_MSC_VER) && (_MSC_VER >= 1020) 7 # pragma once 8 #endif 9 10 // boost/core/quick_exit.hpp 11 // 12 // Copyright 2018 Peter Dimov 13 // 14 // Distributed under the Boost Software License, Version 1.0. 15 // See accompanying file LICENSE_1_0.txt or copy at 16 // http://www.boost.org/LICENSE_1_0.txt) 17 18 #include <boost/config.hpp> 19 #include <stdlib.h> 20 21 #if defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR) 22 23 extern "C" _CRTIMP __cdecl __MINGW_NOTHROW void _exit (int) __MINGW_ATTRIB_NORETURN; 24 25 #endif 26 27 #if defined(__CYGWIN__) && __cplusplus < 201103L 28 29 extern "C" _Noreturn void quick_exit(int); 30 31 #endif 32 33 namespace boost 34 { 35 quick_exit(int code)36BOOST_NORETURN void quick_exit( int code ) BOOST_NOEXCEPT 37 { 38 #if defined(_MSC_VER) && _MSC_VER < 1900 39 40 ::_exit( code ); 41 42 #elif defined(__MINGW32__) 43 44 ::_exit( code ); 45 46 #elif defined(__APPLE__) 47 48 ::_Exit( code ); 49 50 #else 51 52 ::quick_exit( code ); 53 54 #endif 55 } 56 57 } // namespace boost 58 59 #endif // #ifndef BOOST_CORE_QUICK_EXIT_HPP_INCLUDED 60