Fix the following error for ocl::getOpenCLPlatforms() on Ubuntu 12.04 with gcc 4.8

OpenCV Error: Unknown error code -6 (OpenCL function is not available: [clGetPlatformIDs]) in opencl_check_fn, file /home/ahb/software/opencv/modules/ocl/src/cl_runtime/cl_runtime.cpp, line 83

The issue results from modules/ocl/src/cl_runtime/cl_runtime.cpp checking for
"linux" instead of "__linux__" (cp.  http://sourceforge.net/p/predef/wiki/OperatingSystems/)

Adjust all other occurrences of "defined(linux)" as well.
pull/2145/head
ahb 11 years ago
parent 9628abc786
commit 49dfa5a17f
  1. 2
      3rdparty/include/opencl/1.2/CL/cl.hpp
  2. 2
      modules/ocl/src/cl_runtime/cl_runtime.cpp
  3. 2
      modules/ocl/src/cl_runtime/clamdblas_runtime.cpp
  4. 2
      modules/ocl/src/cl_runtime/clamdfft_runtime.cpp
  5. 2
      modules/ocl/src/cl_runtime/generator/template/clamdblas_runtime.cpp.in
  6. 2
      modules/ocl/src/cl_runtime/generator/template/clamdfft_runtime.cpp.in

@ -210,7 +210,7 @@
#include <string>
#endif
#if defined(linux) || defined(__APPLE__) || defined(__MACOSX)
#if defined(__linux__) || defined(__APPLE__) || defined(__MACOSX)
#include <alloca.h>
#include <emmintrin.h>

@ -45,7 +45,7 @@
#define CV_CL_GET_PROC_ADDRESS(name) WinGetProcAddress(name)
#endif // _WIN32
#if defined(linux)
#if defined(__linux__)
#include <dlfcn.h>
#include <stdio.h>

@ -27,7 +27,7 @@
#define CV_CL_GET_PROC_ADDRESS(name) WinGetProcAddress(name)
#endif // _WIN32
#if defined(linux)
#if defined(__linux__)
#include <dlfcn.h>
#include <stdio.h>

@ -27,7 +27,7 @@
#define CV_CL_GET_PROC_ADDRESS(name) WinGetProcAddress(name)
#endif // _WIN32
#if defined(linux)
#if defined(__linux__)
#include <dlfcn.h>
#include <stdio.h>

@ -24,7 +24,7 @@
#define CV_CL_GET_PROC_ADDRESS(name) WinGetProcAddress(name)
#endif // _WIN32
#if defined(linux)
#if defined(__linux__)
#include <dlfcn.h>
#include <stdio.h>

@ -24,7 +24,7 @@
#define CV_CL_GET_PROC_ADDRESS(name) WinGetProcAddress(name)
#endif // _WIN32
#if defined(linux)
#if defined(__linux__)
#include <dlfcn.h>
#include <stdio.h>

Loading…
Cancel
Save