libcxx initial import
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@103490 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
53
src/iostream.cpp
Normal file
53
src/iostream.cpp
Normal file
@@ -0,0 +1,53 @@
|
||||
//===------------------------ iostream.cpp --------------------------------===//
|
||||
//
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "__std_stream"
|
||||
#include "string"
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
static __stdinbuf<char> __cin(stdin);
|
||||
static __stdoutbuf<char> __cout(stdout);
|
||||
static __stdoutbuf<char> __cerr(stderr);
|
||||
static __stdinbuf<wchar_t> __wcin(stdin);
|
||||
static __stdoutbuf<wchar_t> __wcout(stdout);
|
||||
static __stdoutbuf<wchar_t> __wcerr(stderr);
|
||||
|
||||
istream cin(&__cin);
|
||||
ostream cout(&__cout);
|
||||
ostream cerr(&__cerr);
|
||||
ostream clog(&__cerr);
|
||||
wistream wcin(&__wcin);
|
||||
wostream wcout(&__wcout);
|
||||
wostream wcerr(&__wcerr);
|
||||
wostream wclog(&__wcerr);
|
||||
|
||||
ios_base::Init __start_std_streams;
|
||||
|
||||
ios_base::Init::Init()
|
||||
{
|
||||
cin.tie(&cout);
|
||||
_STD::unitbuf(cerr);
|
||||
cerr.tie(&cout);
|
||||
|
||||
wcin.tie(&wcout);
|
||||
_STD::unitbuf(wcerr);
|
||||
wcerr.tie(&wcout);
|
||||
}
|
||||
|
||||
ios_base::Init::~Init()
|
||||
{
|
||||
cout.flush();
|
||||
clog.flush();
|
||||
|
||||
wcout.flush();
|
||||
wclog.flush();
|
||||
}
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
Reference in New Issue
Block a user