From ab8d50e5947ec29df7f8f8cf892e5b99eea40d9b Mon Sep 17 00:00:00 2001 From: Charlie Fenton Date: Sat, 14 Feb 2009 01:43:08 +0000 Subject: [PATCH] SS: On Windows, make path strings Unicode compatible in ss coordinator svn path=/trunk/boinc/; revision=17273 --- checkin_notes | 6 ++++++ clientscr/screensaver.cpp | 14 ++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/checkin_notes b/checkin_notes index 977dab0c24..999ea23a05 100644 --- a/checkin_notes +++ b/checkin_notes @@ -1595,3 +1595,9 @@ David 13 Feb 2009 lib/ gui_rpc_client_ops.cpp gui_rpc_client.h + +Charlie 13 Feb 2009 + - SS: On Windows, make path strings Unicode compatible in ss coordinator. + + clientscr/ + screensaver.cpp diff --git a/clientscr/screensaver.cpp b/clientscr/screensaver.cpp index ab3c80cbfb..ea77b08f6d 100644 --- a/clientscr/screensaver.cpp +++ b/clientscr/screensaver.cpp @@ -41,9 +41,15 @@ #include "gui_rpc_client.h" #include "screensaver_win.h" #include "str_util.h" -#define PATH_SEPARATOR "\\" +// Allow for Unicode wide characters +#define PATH_SEPARATOR (_T("\\")) +#define THE_DEFAULT_SS_EXECUTABLE (_T(DEFAULT_SS_EXECUTABLE)) +#define THE_SS_CONFIG_FILE (_T(SS_CONFIG_FILE)) #else +// Using (_T()) here causes compiler errors on Mac #define PATH_SEPARATOR "/" +#define THE_DEFAULT_SS_EXECUTABLE DEFAULT_SS_EXECUTABLE +#define THE_SS_CONFIG_FILE SS_CONFIG_FILE #endif #ifdef __APPLE__ @@ -321,7 +327,7 @@ int CScreensaver::launch_default_screensaver(char *dir_path, int& graphics_appli strlcpy(full_path, dir_path, sizeof(full_path)); strlcat(full_path, PATH_SEPARATOR, sizeof(full_path)); - strlcat(full_path, DEFAULT_SS_EXECUTABLE, sizeof(full_path)); + strlcat(full_path, THE_DEFAULT_SS_EXECUTABLE, sizeof(full_path)); // For unknown reasons, the graphics application exits with // "RegisterProcess failed (error = -50)" unless we pass its @@ -404,7 +410,7 @@ retval = 0; #endif strlcpy(full_path, default_ss_dir_path, sizeof(full_path)); strlcat(full_path, PATH_SEPARATOR, sizeof(full_path)); - strlcat(full_path, DEFAULT_SS_EXECUTABLE, sizeof(full_path)); + strlcat(full_path, THE_DEFAULT_SS_EXECUTABLE, sizeof(full_path)); if (boinc_file_exists(full_path)) { m_bDefault_ss_exists = true; @@ -760,7 +766,7 @@ void CScreensaver::GetDisplayPeriods(char *dir_path) { strlcpy(buf, dir_path, sizeof(buf)); strlcat(buf, PATH_SEPARATOR, sizeof(buf)); - strlcat(buf, SS_CONFIG_FILE, sizeof(buf)); + strlcat(buf, THE_SS_CONFIG_FILE, sizeof(buf)); f = boinc_fopen(buf, "r"); if (!f) return;