iostream 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. // -*- C++ -*-
  2. //===----------------------------------------------------------------------===//
  3. //
  4. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  5. // See https://llvm.org/LICENSE.txt for license information.
  6. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  7. //
  8. //===----------------------------------------------------------------------===//
  9. #ifndef _LIBCPP_IOSTREAM
  10. #define _LIBCPP_IOSTREAM
  11. /*
  12. iostream synopsis
  13. #include <ios>
  14. #include <istream>
  15. #include <ostream>
  16. #include <streambuf>
  17. namespace std {
  18. extern istream cin;
  19. extern ostream cout;
  20. extern ostream cerr;
  21. extern ostream clog;
  22. extern wistream wcin;
  23. extern wostream wcout;
  24. extern wostream wcerr;
  25. extern wostream wclog;
  26. } // std
  27. */
  28. #include <__assert> // all public C++ headers provide the assertion handler
  29. #include <__config>
  30. #include <version>
  31. // standard-mandated includes
  32. #include <ios>
  33. #include <istream>
  34. #include <ostream>
  35. #include <streambuf>
  36. #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
  37. # pragma GCC system_header
  38. #endif
  39. _LIBCPP_BEGIN_NAMESPACE_STD
  40. #if defined(_MSC_VER) && !defined(__clang__)
  41. extern _LIBCPP_FUNC_VIS istream& cin;
  42. #else
  43. extern _LIBCPP_FUNC_VIS istream cin;
  44. #endif
  45. #if defined(_MSC_VER) && !defined(__clang__)
  46. extern _LIBCPP_FUNC_VIS ostream& cout;
  47. #else
  48. extern _LIBCPP_FUNC_VIS ostream cout;
  49. #endif
  50. #if defined(_MSC_VER) && !defined(__clang__)
  51. extern _LIBCPP_FUNC_VIS ostream& cerr;
  52. extern _LIBCPP_FUNC_VIS ostream& clog;
  53. #else
  54. extern _LIBCPP_FUNC_VIS ostream cerr;
  55. extern _LIBCPP_FUNC_VIS ostream clog;
  56. #endif
  57. #ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
  58. #if defined(_MSC_VER) && !defined(__clang__)
  59. extern _LIBCPP_FUNC_VIS wistream& wcin;
  60. #else
  61. extern _LIBCPP_FUNC_VIS wistream wcin;
  62. #endif
  63. #if defined(_MSC_VER) && !defined(__clang__)
  64. extern _LIBCPP_FUNC_VIS wostream& wcout;
  65. #else
  66. extern _LIBCPP_FUNC_VIS wostream wcout;
  67. #endif
  68. #if defined(_MSC_VER) && !defined(__clang__)
  69. extern _LIBCPP_FUNC_VIS wostream& wcerr;
  70. extern _LIBCPP_FUNC_VIS wostream& wclog;
  71. #else
  72. extern _LIBCPP_FUNC_VIS wostream wcerr;
  73. extern _LIBCPP_FUNC_VIS wostream wclog;
  74. #endif
  75. #endif
  76. _LIBCPP_END_NAMESPACE_STD
  77. #endif // _LIBCPP_IOSTREAM