cstdlib.hpp 1.7 KB

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