26 #if defined (HAVE_CONFIG_H)
35 #if defined (OCTAVE_USE_WINDOWS_API) && defined (_UNICODE)
40 # include <versionhelpers.h>
47 #include "liboctgui-build-info.h"
53 #include "qt-application.h"
70 std::string liboctgui_id = liboctgui_hg_id ();
72 if (octave_id != liboctave_id)
74 std::cerr <<
"octave hg id ("
76 <<
") does not match liboctave hg id ("
82 if (octave_id != liboctinterp_id)
84 std::cerr <<
"octave hg id ("
86 <<
") does not match liboctinterp hg id ("
92 if (octave_id != liboctgui_id)
94 std::cerr <<
"octave hg id ("
96 <<
") does not match liboctgui hg id ("
106 #if defined (OCTAVE_USE_WINDOWS_API) && defined (_UNICODE)
109 wmain (
int argc,
wchar_t **wargv)
111 static char **argv =
new char * [argc + 1];
112 std::vector<std::string> argv_str;
115 std::wstring_convert<std::codecvt_utf8<wchar_t>,
wchar_t> wchar_conv;
116 for (
int i_arg = 0; i_arg < argc; i_arg++)
117 argv_str.push_back (wchar_conv.to_bytes (wargv[i_arg]));
120 for (
int i_arg = 0; i_arg < argc; i_arg++)
121 argv[i_arg] = &argv_str[i_arg][0];
122 argv[argc] =
nullptr;
124 unsigned int old_console_codepage = 0;
125 unsigned int old_console_output_codepage = 0;
127 if (IsWindows7OrGreater ())
130 old_console_codepage = GetConsoleCP ();
131 old_console_output_codepage = GetConsoleOutputCP ();
134 SetConsoleCP (65001);
135 SetConsoleOutputCP (65001);
143 check_hg_versions ();
145 octave::sys::env::set_program_name (argv[0]);
147 octave::qt_application app (
"octave",
"octave-gui",
OCTAVE_VERSION,
150 int ret = app.execute ();
152 #if defined (OCTAVE_USE_WINDOWS_API) && defined (_UNICODE)
153 if (IsWindows7OrGreater ())
156 if (old_console_codepage)
157 SetConsoleCP (old_console_codepage);
158 if (old_console_output_codepage)
159 SetConsoleOutputCP (old_console_output_codepage);
std::string liboctave_hg_id()
std::string liboctinterp_hg_id()
int main(int argc, char **argv)
std::string octave_hg_id()