26 #if defined (HAVE_CONFIG_H)
35 #if defined (OCTAVE_USE_WINDOWS_API) && defined (_UNICODE)
40 # include <versionhelpers.h>
68 if (octave_id != liboctave_id)
70 std::cerr <<
"octave hg id ("
72 <<
") does not match liboctave hg id ("
78 if (octave_id != liboctinterp_id)
80 std::cerr <<
"octave hg id ("
82 <<
") does not match liboctinterp hg id ("
92 #if defined (OCTAVE_USE_WINDOWS_API) && defined (_UNICODE)
95 wmain (
int argc,
wchar_t **wargv)
97 static char **argv =
new char * [argc + 1];
98 std::vector<std::string> argv_str;
101 std::wstring_convert<std::codecvt_utf8<wchar_t>,
wchar_t> wchar_conv;
102 for (
int i_arg = 0; i_arg < argc; i_arg++)
103 argv_str.push_back (wchar_conv.to_bytes (wargv[i_arg]));
106 for (
int i_arg = 0; i_arg < argc; i_arg++)
107 argv[i_arg] = &argv_str[i_arg][0];
108 argv[argc] =
nullptr;
110 unsigned int old_console_codepage = 0;
111 unsigned int old_console_output_codepage = 0;
113 if (IsWindows7OrGreater ())
116 old_console_codepage = GetConsoleCP ();
117 old_console_output_codepage = GetConsoleOutputCP ();
120 SetConsoleCP (65001);
121 SetConsoleOutputCP (65001);
129 check_hg_versions ();
133 octave::sys::env::set_program_name (argv[0]);
135 octave::cli_application app (argc, argv);
137 int ret = app.execute ();
139 #if defined (OCTAVE_USE_WINDOWS_API) && defined (_UNICODE)
140 if (IsWindows7OrGreater ())
143 if (old_console_codepage)
144 SetConsoleCP (old_console_codepage);
145 if (old_console_output_codepage)
146 SetConsoleOutputCP (old_console_output_codepage);
void octave_block_async_signals()
std::string liboctave_hg_id()
std::string liboctinterp_hg_id()
int main(int argc, char **argv)
std::string octave_hg_id()