Added util/platform module
This commit is contained in:
parent
ab7e832218
commit
665347213d
14
src/util/platform.cpp
Normal file
14
src/util/platform.cpp
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#include "platform.h"
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
|
#include <Windows.h>
|
||||||
|
|
||||||
|
void platform::configure_encoding() {
|
||||||
|
// set utf-8 encoding to console output
|
||||||
|
SetConsoleOutputCP(CP_UTF8);
|
||||||
|
setvbuf(stdout, nullptr, _IOFBF, 1000);
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
void platform::configure_encoding(){
|
||||||
|
}
|
||||||
|
#endif
|
||||||
8
src/util/platform.h
Normal file
8
src/util/platform.h
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
#ifndef UTIL_PLATFORM_H_
|
||||||
|
#define UTIL_PLATFORM_H_
|
||||||
|
|
||||||
|
namespace platform {
|
||||||
|
extern void configure_encoding();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // UTIL_PLATFORM_H_
|
||||||
Loading…
x
Reference in New Issue
Block a user