@@ -351,6 +351,9 @@ typedef void(*CustomPrefixCallback)(std::ostream& s, const LogMessageInfo& l, vo
351351#pragma push_macro("DECLARE_VARIABLE")
352352#pragma push_macro("DECLARE_bool")
353353#pragma push_macro("DECLARE_string")
354+ #if defined(GLOG_OS_WINDOWS ) && defined(UNICODE )
355+ #pragma push_macro("DECLARE_wstring")
356+ #endif
354357#pragma push_macro("DECLARE_int32")
355358#pragma push_macro("DECLARE_uint32")
356359
@@ -366,6 +369,12 @@ typedef void(*CustomPrefixCallback)(std::ostream& s, const LogMessageInfo& l, vo
366369#undef DECLARE_string
367370#endif
368371
372+ #if defined(GLOG_OS_WINDOWS ) && defined(UNICODE )
373+ #ifdef DECLARE_wstring
374+ #undef DECLARE_wstring
375+ #endif
376+ #endif
377+
369378#ifdef DECLARE_int32
370379#undef DECLARE_int32
371380#endif
@@ -402,8 +411,19 @@ typedef void(*CustomPrefixCallback)(std::ostream& s, const LogMessageInfo& l, vo
402411 extern GLOG_EXPORT std::string& FLAGS_##name; \
403412 } \
404413 using fLS::FLAGS_##name
414+
415+ #if defined(GLOG_OS_WINDOWS ) && defined(UNICODE )
416+ #define DECLARE_wstring (name ) \
417+ namespace fLS { \
418+ extern GLOG_EXPORT std::wstring& FLAGS_##name; \
419+ } \
420+ using fLS::FLAGS_##name
421+ #endif
422+
405423#endif
406424
425+
426+
407427// Set whether appending a timestamp to the log file name
408428DECLARE_bool (timestamp_in_logfile_name );
409429
@@ -448,7 +468,12 @@ DECLARE_int32(minloglevel);
448468
449469// If specified, logfiles are written into this directory instead of the
450470// default logging directory.
471+
472+ #if defined(GLOG_OS_WINDOWS ) && defined(UNICODE )
473+ DECLARE_wstring (log_dir );
474+ #else
451475DECLARE_string (log_dir );
476+ #endif
452477
453478// Set the log file mode.
454479DECLARE_int32 (logfile_mode );
@@ -1574,9 +1599,13 @@ GLOG_EXPORT void FlushLogFilesUnsafe(LogSeverity min_severity);
15741599// messages is sent. If base_filename is "", it means "don't log this
15751600// severity". Thread-safe.
15761601//
1602+ #if defined(GLOG_OS_WINDOWS ) && defined(UNICODE )
1603+ GLOG_EXPORT void SetLogDestination (LogSeverity severity ,
1604+ const wchar_t * base_filename );
1605+ #else
15771606GLOG_EXPORT void SetLogDestination (LogSeverity severity ,
15781607 const char * base_filename );
1579-
1608+ #endif
15801609//
15811610// Set the basename of the symlink to the latest log file at a given
15821611// severity. If symlink_basename is empty, do not make a symlink. If
@@ -1668,8 +1697,11 @@ GLOG_EXPORT void SetEmailLogging(LogSeverity min_severity,
16681697// list of addresses. Thread-safe.
16691698GLOG_EXPORT bool SendEmail (const char * dest , const char * subject ,
16701699 const char * body );
1671-
1700+ #if defined(GLOG_OS_WINDOWS ) && defined(UNICODE )
1701+ GLOG_EXPORT const std ::vector < std ::wstring > & GetLoggingDirectories ();
1702+ #else
16721703GLOG_EXPORT const std ::vector < std ::string > & GetLoggingDirectories ();
1704+ #endif
16731705
16741706// For tests only: Clear the internal [cached] list of logging directories to
16751707// force a refresh the next time GetLoggingDirectories is called.
@@ -1679,8 +1711,13 @@ void TestOnly_ClearLoggingDirectoriesList();
16791711// Returns a set of existing temporary directories, which will be a
16801712// subset of the directories returned by GetLoggingDirectories().
16811713// Thread-safe.
1714+ #if defined(GLOG_OS_WINDOWS ) && defined(UNICODE )
1715+ GLOG_EXPORT void GetExistingTempDirectories (
1716+ std ::vector < std ::wstring > * list );
1717+ #else
16821718GLOG_EXPORT void GetExistingTempDirectories (
16831719 std ::vector < std ::string > * list );
1720+ #endif
16841721
16851722// Print any fatal message again -- useful to call from signal handler
16861723// so that the last thing in the output is the fatal message.
@@ -1839,6 +1876,9 @@ GLOG_EXPORT void InstallFailureWriter(
18391876#pragma pop_macro("DECLARE_VARIABLE")
18401877#pragma pop_macro("DECLARE_bool")
18411878#pragma pop_macro("DECLARE_string")
1879+ #if defined(GLOG_OS_WINDOWS ) && defined(UNICODE )
1880+ #pragma pop_macro("DECLARE_wstring")
1881+ #endif
18421882#pragma pop_macro("DECLARE_int32")
18431883#pragma pop_macro("DECLARE_uint32")
18441884
0 commit comments