ian@0: // ian@0: // Boost.Process ian@0: // ~~~~~~~~~~~~~ ian@0: // ian@0: // Copyright (c) 2006, 2007 Julio M. Merino Vidal ian@0: // Copyright (c) 2008 Ilya Sokolov, Boris Schaeling ian@0: // Copyright (c) 2009 Boris Schaeling ian@0: // Copyright (c) 2010 Felipe Tanus, Boris Schaeling ian@0: // ian@0: // Distributed under the Boost Software License, Version 1.0. (See accompanying ian@0: // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ian@0: // ian@0: ian@0: /** ian@0: * \file boost/process/config.hpp ian@0: * ian@0: * Defines macros that are used by the library to determine the operating ian@0: * system it is running under and the features it supports. ian@0: */ ian@0: ian@0: #ifndef BOOST_PROCESS_CONFIG_HPP ian@0: #define BOOST_PROCESS_CONFIG_HPP ian@0: ian@0: #include ian@0: #include ian@0: #include ian@0: #include ian@0: ian@0: #if defined(BOOST_POSIX_API) ian@0: # include ian@0: #elif defined(BOOST_WINDOWS_API) ian@0: # include ian@0: #endif ian@0: ian@0: #if defined(BOOST_POSIX_API) || defined(BOOST_PROCESS_DOXYGEN) ian@0: # if !defined(BOOST_PROCESS_POSIX_PATH_MAX) || defined(BOOST_PROCESS_DOXYGEN) ian@0: /** ian@0: * Specifies the system's maximal supported path length. ian@0: * ian@0: * The macro BOOST_PROCESS_POSIX_PATH_MAX is set to a positive integer ian@0: * value which specifies the system's maximal supported path length. It is ian@0: * only used if neither PATH_MAX nor _PC_PATH_MAX and HAVE_PATHCONF are defined. ian@0: * The maximal supported path length is required by ian@0: * boost::process::self::get_work_dir(). Please note that this function is ian@0: * also called by the constructor of boost::process::context. ian@0: */ ian@0: # define BOOST_PROCESS_POSIX_PATH_MAX 259 ian@0: # endif ian@0: #endif ian@0: ian@0: /** \cond */ ian@0: #define BOOST_PROCESS_SOURCE_LOCATION \ ian@0: "in file '" __FILE__ "', line " BOOST_STRINGIZE(__LINE__) ": " ian@0: ian@0: #if defined(BOOST_POSIX_API) ian@0: # define BOOST_PROCESS_LAST_ERROR errno ian@0: #elif defined(BOOST_WINDOWS_API) ian@0: # define BOOST_PROCESS_LAST_ERROR GetLastError() ian@0: #endif ian@0: ian@0: #define BOOST_PROCESS_THROW_LAST_SYSTEM_ERROR(what) \ ian@0: boost::throw_exception(boost::system::system_error( \ ian@0: boost::system::error_code(BOOST_PROCESS_LAST_ERROR, \ ian@0: boost::system::get_system_category()), \ ian@0: BOOST_PROCESS_SOURCE_LOCATION what)) ian@0: ian@0: #define BOOST_PROCESS_THROW_ERROR(error, what) \ ian@0: boost::throw_exception(boost::system::system_error( \ ian@0: boost::system::error_code(error, \ ian@0: boost::system::get_system_category()), \ ian@0: BOOST_PROCESS_SOURCE_LOCATION what)) ian@0: /** \endcond */ ian@0: ian@0: #endif