mirror of
https://gitee.com/acl-dev/acl.git
synced 2024-12-14 17:00:52 +08:00
50 lines
688 B
C++
50 lines
688 B
C++
#include "acl_stdafx.hpp"
|
|
#include "acl_cpp/acl_cpp_init.hpp"
|
|
|
|
namespace acl
|
|
{
|
|
|
|
void acl_cpp_init(void)
|
|
{
|
|
acl_lib_init();
|
|
}
|
|
|
|
#ifdef ACL_WINDOWS
|
|
|
|
static FILE* dos_fp_ = NULL;
|
|
|
|
void open_dos(void)
|
|
{
|
|
if (dos_fp_)
|
|
return;
|
|
|
|
// ´ò¿ª DOS ´°¿Ú
|
|
AllocConsole();
|
|
|
|
#if _MSC_VER >= 1500
|
|
if (freopen_s(&dos_fp_,"CONOUT$", "w+t", stdout) != 0)
|
|
dos_fp_ = NULL;
|
|
#else
|
|
dos_fp_ = freopen("CONOUT$", "w+t", stdout);
|
|
#endif
|
|
if (dos_fp_ == NULL)
|
|
{
|
|
printf("open DOS error %s\r\n", last_serror());
|
|
FreeConsole();
|
|
}
|
|
}
|
|
|
|
void close_dos(void)
|
|
{
|
|
if (dos_fp_)
|
|
{
|
|
fclose(dos_fp_);
|
|
FreeConsole();
|
|
dos_fp_ = NULL;
|
|
}
|
|
}
|
|
|
|
#endif
|
|
|
|
} // namespace acl
|