diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx index 29dc9f8b3aaf..ef46c4826a2d 100644 --- a/sc/source/core/opencl/formulagroupcl.cxx +++ b/sc/source/core/opencl/formulagroupcl.cxx @@ -82,17 +82,6 @@ static const char* publicFunc = "double strequal(unsigned a, unsigned b) { return (a==b)?1.0:0; }\n" ; -#ifdef _WIN32 -#ifndef NAN -namespace { - -const unsigned long __nan[2] = {0xffffffff, 0x7fffffff}; - -} -#define NAN (*(const double*) __nan) -#endif -#endif - #include #include #include @@ -238,7 +227,7 @@ size_t VectorRef::Marshal( cl_kernel k, int argno, int, cl_program ) throw OpenCLError("clEnqueueMapBuffer", err, __FILE__, __LINE__); for (size_t i = 0; i < szHostBuffer / sizeof(double); i++) - pNanBuffer[i] = NAN; + rtl::math::setNan(&pNanBuffer[i]); err = clEnqueueUnmapMemObject(kEnv.mpkCmdQueue, mpClmem, pNanBuffer, 0, nullptr, nullptr); // FIXME: Is it intentional to not throw an OpenCLError even if the clEnqueueUnmapMemObject() fails?