Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/torch/qtlua.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRui Guo <guorui.xt@gmail.com>2016-10-13 17:35:04 +0300
committerRui Guo <guorui.xt@gmail.com>2016-10-13 17:35:04 +0300
commit4c15a02b88f74b209a4290981fea6754280e7da9 (patch)
tree804bbed67b4c3051b6922e6ba5dae8a199babcfc
parent65956c573f594885282f829483038874d5e2848d (diff)
change to work on windows with msvc
-rw-r--r--qlua/qlua.cpp2
-rw-r--r--qlua/qluaconsole_win.cpp8
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));