Hackz.
authorCarl Hetherington <cth@carlh.net>
Wed, 5 Aug 2020 21:19:47 +0000 (23:19 +0200)
committerCarl Hetherington <cth@carlh.net>
Thu, 6 Aug 2020 07:38:43 +0000 (09:38 +0200)
src/tools/dcpomatic_disk.cc
src/tools/wscript

index b94d4bf941016c4deb5e898040c7e50995c88fe5..c4a04aea8eee6cfe983851c2905698c9a0d772d9 100644 (file)
@@ -62,6 +62,23 @@ public:
                , _nanomsg (true)
                , _sizer (new wxBoxSizer(wxVERTICAL))
        {
+#if defined(DCPOMATIC_WINDOWS)
+               AllocConsole();
+
+               HANDLE handle_out = GetStdHandle(STD_OUTPUT_HANDLE);
+               int hCrt = _open_osfhandle((intptr_t) handle_out, _O_TEXT);
+               FILE* hf_out = _fdopen(hCrt, "w");
+               setvbuf(hf_out, NULL, _IONBF, 1);
+               *stdout = *hf_out;
+
+               HANDLE handle_in = GetStdHandle(STD_INPUT_HANDLE);
+               hCrt = _open_osfhandle((intptr_t) handle_in, _O_TEXT);
+               FILE* hf_in = _fdopen(hCrt, "r");
+               setvbuf(hf_in, NULL, _IONBF, 128);
+               *stdin = *hf_in;
+
+               cout << "DCP-o-matic is starting." << "\n";
+#endif
                /* Use a panel as the only child of the Frame so that we avoid
                   the dark-grey background on Windows.
                */
index 7eeeecddfb80d48c909f290c7c14831cd79261e7..2f8761f23bde0649426d155fb896cf3640dfebfb 100644 (file)
@@ -61,7 +61,7 @@ def build(bld):
         if bld.env.TARGET_WINDOWS and t == 'dcpomatic_disk_writer':
             obj.source += ' ../../platform/windows/%s.rc' % t
             # Prevent a console window opening when we start dcpomatic2_disk_writer
-            bld.env.LINKFLAGS.append('-Wl,-subsystem,windows')
+            bld.env.LINKFLAGS.append('-Wl,-subsystem,windows')
         obj.target = t.replace('dcpomatic', 'dcpomatic2').replace('swaroop_', '')
         if t == 'server_test':
             obj.install_path = None