ExitCodes.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===-- llvm/Support/ExitCodes.h - Exit codes for exit() -------*- C++ -*-===//
  7. //
  8. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  9. // See https://llvm.org/LICENSE.txt for license information.
  10. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  11. //
  12. //===----------------------------------------------------------------------===//
  13. ///
  14. /// \file
  15. /// This file contains definitions of exit codes for exit() function. They are
  16. /// either defined by sysexits.h if it is supported, or defined here if
  17. /// sysexits.h is not supported.
  18. ///
  19. //===----------------------------------------------------------------------===//
  20. #ifndef LLVM_SUPPORT_EXITCODES_H
  21. #define LLVM_SUPPORT_EXITCODES_H
  22. #include "llvm/Config/llvm-config.h"
  23. #if HAVE_SYSEXITS_H
  24. #include <sysexits.h>
  25. #elif __MVS__ || defined(_WIN32)
  26. // <sysexits.h> does not exist on z/OS and Windows. The only value used in LLVM
  27. // is EX_IOERR, which is used to signal a special error condition (broken pipe).
  28. // Define the macro with its usual value from BSD systems, which is chosen to
  29. // not clash with more standard exit codes like 1.
  30. #define EX_IOERR 74
  31. #elif LLVM_ON_UNIX
  32. #error Exit code EX_IOERR not available
  33. #endif
  34. #endif
  35. #ifdef __GNUC__
  36. #pragma GCC diagnostic pop
  37. #endif