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