summaryrefslogtreecommitdiff
path: root/opencl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-08-19 10:10:53 +0100
committerCaolán McNamara <caolanm@redhat.com>2016-08-19 13:00:44 +0100
commite1d50431a0107a1c0b0313a85b1856088353f777 (patch)
treefbe01bdf4d3b1b6caa4dadd7e67e2c92449ad732 /opencl
parentaf743edb6452beca15b47c288b97d50e8d2b8892 (diff)
coverity#1371130 'Constant' variable guards dead code
Change-Id: I94ac63f009cb398ef88e4889084bb9a99eb8bf6c
Diffstat (limited to 'opencl')
-rw-r--r--opencl/source/openclwrapper.cxx13
1 files changed, 8 insertions, 5 deletions
diff --git a/opencl/source/openclwrapper.cxx b/opencl/source/openclwrapper.cxx
index 32f0e5f4effc..43330a6bae31 100644
--- a/opencl/source/openclwrapper.cxx
+++ b/opencl/source/openclwrapper.cxx
@@ -479,12 +479,12 @@ bool initOpenCLRunEnv( GPUEnv *gpuInfo )
clGetPlatformInfo(gpuInfo->mpPlatformID, CL_PLATFORM_NAME, 64,
pName, nullptr);
- bool bIsNotWinOrIsWin8OrGreater = true;
-
+#if defined (_WIN32)
// the Win32 SDK 8.1 deprecates GetVersionEx()
-#ifdef _WIN32_WINNT_WINBLUE
- bIsNotWinOrIsWin8OrGreater = IsWindows8OrGreater();
-#elif defined (_WIN32)
+# ifdef _WIN32_WINNT_WINBLUE
+ const bool bIsNotWinOrIsWin8OrGreater = IsWindows8OrGreater();
+# else
+ bool bIsNotWinOrIsWin8OrGreater = true;
OSVERSIONINFO aVersionInfo;
memset( &aVersionInfo, 0, sizeof(aVersionInfo) );
aVersionInfo.dwOSVersionInfoSize = sizeof( aVersionInfo );
@@ -495,6 +495,9 @@ bool initOpenCLRunEnv( GPUEnv *gpuInfo )
(aVersionInfo.dwMajorVersion == 6 && aVersionInfo.dwMinorVersion < 2))
bIsNotWinOrIsWin8OrGreater = false;
}
+# endif
+#else
+ const bool bIsNotWinOrIsWin8OrGreater = true;
#endif
// Heuristic: Certain old low-end OpenCL implementations don't