ian@0
|
1 //
|
ian@0
|
2 // Boost.Process
|
ian@0
|
3 // ~~~~~~~~~~~~~
|
ian@0
|
4 //
|
ian@0
|
5 // Copyright (c) 2006, 2007 Julio M. Merino Vidal
|
ian@0
|
6 // Copyright (c) 2008 Ilya Sokolov, Boris Schaeling
|
ian@0
|
7 // Copyright (c) 2009 Boris Schaeling
|
ian@0
|
8 // Copyright (c) 2010 Felipe Tanus, Boris Schaeling
|
ian@0
|
9 //
|
ian@0
|
10 // Distributed under the Boost Software License, Version 1.0. (See accompanying
|
ian@0
|
11 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
ian@0
|
12 //
|
ian@0
|
13
|
ian@0
|
14 /**
|
ian@0
|
15 * \file boost/process/config.hpp
|
ian@0
|
16 *
|
ian@0
|
17 * Defines macros that are used by the library to determine the operating
|
ian@0
|
18 * system it is running under and the features it supports.
|
ian@0
|
19 */
|
ian@0
|
20
|
ian@0
|
21 #ifndef BOOST_PROCESS_CONFIG_HPP
|
ian@0
|
22 #define BOOST_PROCESS_CONFIG_HPP
|
ian@0
|
23
|
ian@0
|
24 #include <boost/config.hpp>
|
ian@0
|
25 #include <boost/system/config.hpp>
|
ian@0
|
26 #include <boost/system/system_error.hpp>
|
ian@0
|
27 #include <boost/throw_exception.hpp>
|
ian@0
|
28
|
ian@0
|
29 #if defined(BOOST_POSIX_API)
|
ian@0
|
30 # include <errno.h>
|
ian@0
|
31 #elif defined(BOOST_WINDOWS_API)
|
ian@0
|
32 # include <windows.h>
|
ian@0
|
33 #endif
|
ian@0
|
34
|
ian@0
|
35 #if defined(BOOST_POSIX_API) || defined(BOOST_PROCESS_DOXYGEN)
|
ian@0
|
36 # if !defined(BOOST_PROCESS_POSIX_PATH_MAX) || defined(BOOST_PROCESS_DOXYGEN)
|
ian@0
|
37 /**
|
ian@0
|
38 * Specifies the system's maximal supported path length.
|
ian@0
|
39 *
|
ian@0
|
40 * The macro BOOST_PROCESS_POSIX_PATH_MAX is set to a positive integer
|
ian@0
|
41 * value which specifies the system's maximal supported path length. It is
|
ian@0
|
42 * only used if neither PATH_MAX nor _PC_PATH_MAX and HAVE_PATHCONF are defined.
|
ian@0
|
43 * The maximal supported path length is required by
|
ian@0
|
44 * boost::process::self::get_work_dir(). Please note that this function is
|
ian@0
|
45 * also called by the constructor of boost::process::context.
|
ian@0
|
46 */
|
ian@0
|
47 # define BOOST_PROCESS_POSIX_PATH_MAX 259
|
ian@0
|
48 # endif
|
ian@0
|
49 #endif
|
ian@0
|
50
|
ian@0
|
51 /** \cond */
|
ian@0
|
52 #define BOOST_PROCESS_SOURCE_LOCATION \
|
ian@0
|
53 "in file '" __FILE__ "', line " BOOST_STRINGIZE(__LINE__) ": "
|
ian@0
|
54
|
ian@0
|
55 #if defined(BOOST_POSIX_API)
|
ian@0
|
56 # define BOOST_PROCESS_LAST_ERROR errno
|
ian@0
|
57 #elif defined(BOOST_WINDOWS_API)
|
ian@0
|
58 # define BOOST_PROCESS_LAST_ERROR GetLastError()
|
ian@0
|
59 #endif
|
ian@0
|
60
|
ian@0
|
61 #define BOOST_PROCESS_THROW_LAST_SYSTEM_ERROR(what) \
|
ian@0
|
62 boost::throw_exception(boost::system::system_error( \
|
ian@0
|
63 boost::system::error_code(BOOST_PROCESS_LAST_ERROR, \
|
ian@0
|
64 boost::system::get_system_category()), \
|
ian@0
|
65 BOOST_PROCESS_SOURCE_LOCATION what))
|
ian@0
|
66
|
ian@0
|
67 #define BOOST_PROCESS_THROW_ERROR(error, what) \
|
ian@0
|
68 boost::throw_exception(boost::system::system_error( \
|
ian@0
|
69 boost::system::error_code(error, \
|
ian@0
|
70 boost::system::get_system_category()), \
|
ian@0
|
71 BOOST_PROCESS_SOURCE_LOCATION what))
|
ian@0
|
72 /** \endcond */
|
ian@0
|
73
|
ian@0
|
74 #endif
|