Well, there's a simple workaround: just use values of these constants instead of their names. For example, _O_U16TEXT
is 0x00020000
and _O_U8TEXT
is 0x00040000
.
I've just confirmed that it works with _setmode
using g++ 4.8.1 on Windows 10:
#include <iostream>
#include <fcntl.h>
#include <io.h>
#include <stdio.h>
int main() {
_setmode(_fileno(stdout), 0x00020000); // _O_U16TEXT
std::wcout << L"Русский текст
";
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…