Skip to content
Snippets Groups Projects
Commit 58eedfe0 authored by dmitriy.gerasimov's avatar dmitriy.gerasimov
Browse files

Merge branch 'support-2719' into 'master'

For future use: unicode paths

See merge request !30
parents 9c1afb9e 227aca87
No related branches found
No related tags found
1 merge request!30For future use: unicode paths
...@@ -335,6 +335,7 @@ extern size_t g_sys_dir_path_len; ...@@ -335,6 +335,7 @@ extern size_t g_sys_dir_path_len;
//int dap_common_init( const char * a_log_file ); //int dap_common_init( const char * a_log_file );
int dap_common_init( const char *console_title, const char *a_log_file ); int dap_common_init( const char *console_title, const char *a_log_file );
int wdap_common_init( const char *console_title, const wchar_t *a_wlog_file);
void dap_common_deinit(void); void dap_common_deinit(void);
......
...@@ -243,6 +243,28 @@ int dap_common_init( const char *a_console_title, const char *a_log_filename ) { ...@@ -243,6 +243,28 @@ int dap_common_init( const char *a_console_title, const char *a_log_filename ) {
return 0; return 0;
} }
int wdap_common_init( const char *a_console_title, const wchar_t *a_log_filename ) {
// init randomer
srand( (unsigned int)time(NULL) );
(void) a_console_title;
strncpy( s_log_tag_fmt_str, "[%s]\t",sizeof (s_log_tag_fmt_str));
for (int i = 0; i < 16; ++i)
s_ansi_seq_color_len[i] =(unsigned int) strlen(s_ansi_seq_color[i]);
if ( a_log_filename ) {
s_log_file = _wfopen( a_log_filename , L"a" );
if( s_log_file == NULL)
s_log_file = _wfopen( a_log_filename , L"w" );
if ( s_log_file == NULL ) {
dap_fprintf( stderr, "Can't open log file %s to append\n", a_log_filename );
return -1;
}
//dap_stpcpy(s_log_file_path, a_log_filename);
}
pthread_create( &s_log_thread, NULL, s_log_thread_proc, NULL );
return 0;
}
/** /**
* @brief dap_common_deinit Deinitialise * @brief dap_common_deinit Deinitialise
*/ */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment