iostream 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. /******************************************************************************/
  2. /* This file was taken from STLport <www.stlport.org> and modified by */
  3. /* Texas Instruments. */
  4. /******************************************************************************/
  5. /*
  6. * Copyright (c) 1999
  7. * Silicon Graphics Computer Systems, Inc.
  8. *
  9. * Copyright (c) 1999
  10. * Boris Fomitchev
  11. *
  12. * Copyright (c) 2014-2014 Texas Instruments Incorporated
  13. *
  14. * This material is provided "as is", with absolutely no warranty expressed
  15. * or implied. Any use is at your own risk.
  16. *
  17. * Permission to use or copy this software for any purpose is hereby granted
  18. * without fee, provided the above notices are retained on all copies.
  19. * Permission to modify the code and to distribute modified code is granted,
  20. * provided the above notices are retained, and a notice that the code was
  21. * modified is included with the above copyright notice.
  22. *
  23. */
  24. #ifndef _STLP_IOSTREAM
  25. #ifndef _STLP_OUTERMOST_HEADER_ID
  26. # define _STLP_OUTERMOST_HEADER_ID 0x1037
  27. # include <s__prolog.h>
  28. # define _STLP_IOSTREAM
  29. #endif
  30. #if (_STLP_OUTERMOST_HEADER_ID == 0x1037) && \
  31. !(defined (_STLP_NO_IOSTREAMS) && defined (_STLP_IMPORT_VENDOR_STD))
  32. # include <s__ioserr.h>
  33. # ifdef _STLP_REDIRECT_STDSTREAMS
  34. // for ofstream redirection
  35. # ifndef _STLP_INTERNAL_FSTREAM_H
  36. # include <s__fstream.h>
  37. # endif
  38. # endif
  39. # ifndef _STLP_INTERNAL_IOSFWD
  40. # include <s__iosfwd.h>
  41. # endif
  42. # ifndef _STLP_INTERNAL_ISTREAM
  43. # include <s__istream.h>
  44. # endif
  45. _STLP_BEGIN_NAMESPACE
  46. /* Workaround since we don't support ensuring library globals are initialized first.
  47. * This declaration ensures that any inclusion of this header will force cout/cin/cerr
  48. * to initialize. */
  49. static ios_base::Init _ios_initer;
  50. # ifndef _STLP_USE_NAMESPACES
  51. // in case of SGI iostreams, we have to rename our streams not to clash with those
  52. // provided in native lib
  53. # define cin _STLP_cin
  54. # define cout _STLP_cout
  55. # define cerr _STLP_cerr
  56. # define clog _STLP_clog
  57. # endif
  58. // Note: cin and wcin are both associated with stdio. The C standard
  59. // (Amendment 1, section 4.6.2.1) says that it is an error to mix
  60. // wide- and narrow-oriented I/O on the same stream. This implies
  61. // that it is an error to use both cin and wcin in the same C++
  62. // program; the same applies to cout and wcout, and cerr/clog and
  63. // wcerr/wclog.
  64. _DATA_ACCESS extern _STLP_DECLSPEC istream cin;
  65. # ifdef _STLP_REDIRECT_STDSTREAMS
  66. _DATA_ACCESS extern _STLP_DECLSPEC ofstream cout;
  67. _DATA_ACCESS extern _STLP_DECLSPEC ofstream cerr;
  68. _DATA_ACCESS extern _STLP_DECLSPEC ofstream clog;
  69. # else
  70. _DATA_ACCESS extern _STLP_DECLSPEC ostream cout;
  71. _DATA_ACCESS extern _STLP_DECLSPEC ostream cerr;
  72. _DATA_ACCESS extern _STLP_DECLSPEC ostream clog;
  73. # endif
  74. # ifndef _STLP_NO_WCHAR_T
  75. _DATA_ACCESS extern _STLP_DECLSPEC wistream wcin;
  76. _DATA_ACCESS extern _STLP_DECLSPEC wostream wcout;
  77. _DATA_ACCESS extern _STLP_DECLSPEC wostream wcerr;
  78. _DATA_ACCESS extern _STLP_DECLSPEC wostream wclog;
  79. # endif
  80. _STLP_END_NAMESPACE
  81. #endif
  82. #if (_STLP_OUTERMOST_HEADER_ID != 0x1037) || defined (_STLP_IMPORT_VENDOR_STD)
  83. # if defined (_STLP_HAS_INCLUDE_NEXT)
  84. # include_next <iostream>
  85. # else
  86. # include _STLP_NATIVE_HEADER(iostream)
  87. # endif
  88. #endif
  89. #if (_STLP_OUTERMOST_HEADER_ID == 0x1037)
  90. # include <s__epilog.h>
  91. # undef _STLP_OUTERMOST_HEADER_ID
  92. #endif
  93. #endif /* _STLP_IOSTREAM */
  94. // Local Variables:
  95. // mode:C++
  96. // End: