From 7e124f9e8b7e4c6b98e9ada56c3dff40197e2f9a Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Fri, 20 Sep 2013 15:38:30 +0300 Subject: Blind fix attempt: extern "C" decls must be at outer level Change-Id: Ic034f63f604d86e420adb0a4106c1501db5a552f --- sc/source/core/tool/formulagroup.cxx | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/sc/source/core/tool/formulagroup.cxx b/sc/source/core/tool/formulagroup.cxx index b1808e07dcd3..0e8aa96d57b7 100644 --- a/sc/source/core/tool/formulagroup.cxx +++ b/sc/source/core/tool/formulagroup.cxx @@ -26,6 +26,16 @@ #include +#ifdef DISABLE_DYNLOADING + +extern "C" size_t getOpenCLPlatformCount(void); +extern "C" void fillOpenCLInfo(OpenclPlatformInfo*, size_t); +extern "C" bool switchOpenClDevice(const OUString*, bool); +extern "C" sc::FormulaGroupInterpreter* createFormulaGroupOpenCLInterpreter(); +extern "C" void compileOpenCLKernels(const OUString*); + +#endif + namespace sc { rtl_uString* FormulaGroupContext::intern( const OUString& rStr ) @@ -402,9 +412,6 @@ void FormulaGroupInterpreter::fillOpenCLInfo(std::vector& rP reinterpret_cast<__fillOpenCLInfo>(fn)(&aPlatforms[0], aPlatforms.size()); rPlatforms.swap(aPlatforms); #else - extern "C" size_t getOpenCLPlatformCount(void); - extern "C" void fillOpenCLInfo(OpenclPlatformInfo*, size_t); - size_t nPlatforms = getOpenCLPlatformCount(); if (!nPlatforms) return; @@ -445,8 +452,6 @@ void FormulaGroupInterpreter::switchOpenCLDevice(const OUString& rDeviceId, bool if(!bSuccess) return; #else - extern "C" bool switchOpenClDevice(const OUString*, bool); - bool bSuccess = switchOpenClDevice(&rDeviceId, bAutoSelect); if(!bSuccess) return; @@ -460,7 +465,6 @@ void FormulaGroupInterpreter::switchOpenCLDevice(const OUString& rDeviceId, bool if ( ScInterpreter::GetGlobalConfig().mbOpenCLEnabled ) { #ifdef DISABLE_DYNLOADING - extern "C" sc::FormulaGroupInterpreter* createFormulaGroupOpenCLInterpreter(); msInstance = createFormulaGroupOpenCLInterpreter(); #else // Dynamically load scopencl shared object, and instantiate the opencl interpreter. @@ -493,7 +497,6 @@ void FormulaGroupInterpreter::compileOpenCLKernels() reinterpret_cast<__compileOpenCLKernels>(fn)(&rConfig.maOpenCLDevice); #else - extern "C" void compileOpenCLKernels(const OUString*); compileOpenCLKernels(&rConfig.maOpenCLDevice); #endif -- cgit