From c8ad5b1defcbc989862032c8fde7c1de5091ee40 Mon Sep 17 00:00:00 2001 From: Charlie Fenton Date: Tue, 17 Feb 2009 01:51:56 +0000 Subject: [PATCH] client: fix compile break on Mac svn path=/trunk/boinc/; revision=17276 --- checkin_notes | 6 ++++++ lib/coproc.cpp | 28 ++++++++++++++++------------ 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/checkin_notes b/checkin_notes index 9b81ee6423..61146fec62 100644 --- a/checkin_notes +++ b/checkin_notes @@ -1618,3 +1618,9 @@ David 16 Feb 2009 coproc.cpp,h win_build/ libboinc.vcproj + +Charlie 13 Feb 2009 + - client: fix compile break on Mac. + + lib/ + coproc.cpp diff --git a/lib/coproc.cpp b/lib/coproc.cpp index 9b58d074d9..6aa061683f 100644 --- a/lib/coproc.cpp +++ b/lib/coproc.cpp @@ -155,18 +155,18 @@ string COPROC_CUDA::get(COPROCS& coprocs) { return "Library doesn't have cudaGetDeviceProperties()"; } - NvAPI_Status nvapiStatus; - NvDisplayHandle hDisplay; - NV_DISPLAY_DRIVER_VERSION Version; - memset(&Version, 0, sizeof(Version)); - Version.version = NV_DISPLAY_DRIVER_VERSION_VER; - - NvAPI_Initialize(); - for (int i=0; ; i++) { - nvapiStatus = NvAPI_EnumNvidiaDisplayHandle(i, &hDisplay); - if (nvapiStatus != NVAPI_OK) break; - nvapiStatus = NvAPI_GetDisplayDriverVersion(hDisplay, &Version); - if (nvapiStatus == NVAPI_OK) break; + NvAPI_Status nvapiStatus; + NvDisplayHandle hDisplay; + NV_DISPLAY_DRIVER_VERSION Version; + memset(&Version, 0, sizeof(Version)); + Version.version = NV_DISPLAY_DRIVER_VERSION_VER; + + NvAPI_Initialize(); + for (int i=0; ; i++) { + nvapiStatus = NvAPI_EnumNvidiaDisplayHandle(i, &hDisplay); + if (nvapiStatus != NVAPI_OK) break; + nvapiStatus = NvAPI_GetDisplayDriverVersion(hDisplay, &Version); + if (nvapiStatus == NVAPI_OK) break; } #else @@ -208,7 +208,11 @@ string COPROC_CUDA::get(COPROCS& coprocs) { (*__cudaGetDeviceProperties)(&cc.prop, i); if (cc.prop.major <= 0) continue; // major == 0 means emulation if (cc.prop.major > 100) continue; // e.g. 9999 is an error +#ifdef _WIN32 cc.drvVersion = Version.drvVersion; +#else + cc.drvVersion = 0; +#endif cc.description(buf); if (real_count) {