williamr@2: // boost/cstdlib.hpp header ------------------------------------------------// williamr@2: williamr@2: // Copyright Beman Dawes 2001. Distributed under the Boost williamr@2: // Software License, Version 1.0. (See accompanying file williamr@2: // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) williamr@2: williamr@2: // See http://www.boost.org/libs/utility/cstdlib.html for documentation. williamr@2: williamr@2: // Revision History williamr@2: // 26 Feb 01 Initial version (Beman Dawes) williamr@2: williamr@2: #ifndef BOOST_CSTDLIB_HPP williamr@2: #define BOOST_CSTDLIB_HPP williamr@2: williamr@2: #include williamr@2: williamr@2: namespace boost williamr@2: { williamr@2: // The intent is to propose the following for addition to namespace std williamr@2: // in the C++ Standard Library, and to then deprecate EXIT_SUCCESS and williamr@2: // EXIT_FAILURE. As an implementation detail, this header defines the williamr@2: // new constants in terms of EXIT_SUCCESS and EXIT_FAILURE. In a new williamr@2: // standard, the constants would be implementation-defined, although it williamr@2: // might be worthwhile to "suggest" (which a standard is allowed to do) williamr@2: // values of 0 and 1 respectively. williamr@2: williamr@2: // Rationale for having multiple failure values: some environments may williamr@2: // wish to distinguish between different classes of errors. williamr@2: // Rationale for choice of values: programs often use values < 100 for williamr@2: // their own error reporting. Values > 255 are sometimes reserved for williamr@2: // system detected errors. 200/201 were suggested to minimize conflict. williamr@2: williamr@2: const int exit_success = EXIT_SUCCESS; // implementation-defined value williamr@2: const int exit_failure = EXIT_FAILURE; // implementation-defined value williamr@2: const int exit_exception_failure = 200; // otherwise uncaught exception williamr@2: const int exit_test_failure = 201; // report_error or williamr@2: // report_critical_error called. williamr@2: } williamr@2: williamr@2: #endif williamr@2: