diff options
author | Soumith Chintala <soumith@gmail.com> | 2016-10-13 19:10:32 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-13 19:10:32 +0300 |
commit | a29e8a72c12db6a10fa37828d906e7afad14a98e (patch) | |
tree | 804bbed67b4c3051b6922e6ba5dae8a199babcfc | |
parent | 65956c573f594885282f829483038874d5e2848d (diff) | |
parent | 4c15a02b88f74b209a4290981fea6754280e7da9 (diff) |
Merge pull request #35 from BTNC/master
change to work on windows with msvc
-rw-r--r-- | qlua/qlua.cpp | 2 | ||||
-rw-r--r-- | qlua/qluaconsole_win.cpp | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/qlua/qlua.cpp b/qlua/qlua.cpp index 548073c..448bd34 100644 --- a/qlua/qlua.cpp +++ b/qlua/qlua.cpp @@ -133,7 +133,7 @@ main(int argc, char **argv) args_for_lua += const_cast<char*>(ideStyle.constData()); } #if defined(TORCH7) - args_for_lua += "-ltorch-env"; + args_for_lua += "-lenv"; #endif while(i < argc_for_both) args_for_lua += argv_for_both[i++]; diff --git a/qlua/qluaconsole_win.cpp b/qlua/qluaconsole_win.cpp index 50bee0b..3ac3564 100644 --- a/qlua/qluaconsole_win.cpp +++ b/qlua/qluaconsole_win.cpp @@ -466,11 +466,19 @@ QLuaConsole::Private::redirect(bool flag) int fd1 = sThread.fds[1]; int fd2 = fd1; if (! trueStdout) +#ifndef _MSC_VER stdout->_file = 1; +#else + freopen("CON", "w", stdout); +#endif else if (! flag) fd1 = _fileno(trueStdout); if (! trueStderr) +#ifndef _MSC_VER stderr->_file = 2; +#else + freopen("CON", "w", stderr); +#endif else if (! flag) fd2 = _fileno(trueStderr); _dup2(fd1, _fileno(stdout)); |