Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

client: show correct info about client version #2388

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 32 additions & 9 deletions client/client_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,13 +257,11 @@ void CLIENT_STATE::show_host_info() {
"VirtualBox version: %s",
host_info.virtualbox_version
);
} else {
#if defined (_WIN32) && !defined(_WIN64)
if (!strcmp(get_primary_platform(), "windows_x86_64")) {
msg_printf(NULL, MSG_USER_ALERT,
"Can't detect VirtualBox because this is a 32-bit version of BOINC; to fix, please install a 64-bit version."
);
}
} else {
msg_printf(NULL, MSG_USER_ALERT,
"Can't detect VirtualBox because this is a 32-bit version of BOINC; to fix, please install a 64-bit version."
);
#endif
}
}
Expand Down Expand Up @@ -413,6 +411,31 @@ static void set_client_priority() {
#endif
}

// return the compile target of the BOINC client
// (not necessarily the same has the host architecture)
// TODO: flesh this out for Linux (architecture, bitness)
//
static const char* client_target() {
#ifdef _WIN32
#ifdef _WIN64
return " for Windows 64-bit";
#endif
return " for Windows 32-bit";
#endif

#ifdef __APPLE__
return " for Mac OS X";
#endif

#if LINUX_LIKE_SYSTEM
return " for Linux";
#endif

#ifdef ANDROID
return " for Android";
#endif
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need a default return type of " for Unknown" or some message in the event that none of the flags _WIN32/_WIN64/APPLE/LINUX_LIKE_SYSTEM/ANDROID is set? I don't know all the cases that things are built and if not having one of these set causes problems elsewhere in the code, but it seems like there should be a default to handle that case.

Note: If the code absolutely requires one of these flags to be set, then I withdraw my comment. However, if the intention is to be able to build the client without one of these flags then a default should exist.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional comment, based on Juha's comments above, the use of HOSTTYPE in the default case would be better than "Unknown"

int CLIENT_STATE::init() {
int retval;
unsigned int i;
Expand All @@ -434,13 +457,13 @@ int CLIENT_STATE::init() {
time_stats.start();

msg_printf(
NULL, MSG_INFO, "Starting BOINC client version %d.%d.%d for %s%s",
NULL, MSG_INFO, "Starting BOINC client version %d.%d.%d%s%s",
core_client_version.major,
core_client_version.minor,
core_client_version.release,
get_primary_platform(),
client_target(),
#ifdef _DEBUG
" (DEBUG)"
" (Debug)"
#else
""
#endif
Expand Down