summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2015-02-08 11:04:13 +0200
committerTor Lillqvist <tml@collabora.com>2015-02-08 11:04:13 +0200
commit61f3f968f3c59608a17b3410630352ab0f70b4a5 (patch)
tree486e8e873433c361f034008fe5397f81b889cce3 /sc
parent1aa1a1c71de6604cd2c45e393ba3194c3d85bc9a (diff)
Avoid OpenCL compilation error when multiple RAND() calls in a formula
Simply surround the Random123 code snippet with an ifdef guard. Change-Id: I370a3c37226d31bfbe703e5b7936b2180aee1784
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/opencl/formulagroupcl.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx
index 993bd53fd4c6..df5659103a5a 100644
--- a/sc/source/core/opencl/formulagroupcl.cxx
+++ b/sc/source/core/opencl/formulagroupcl.cxx
@@ -415,6 +415,10 @@ public:
// of course. Only the code that calculates the counter-based
// random number and what it needs is left.
ss << "\
+\n\
+#ifndef DEFINED_RANDOM123_STUFF\n\
+#define DEFINED_RANDOM123_STUFF\n\
+\n\
/*\n\
Copyright 2010-2011, D. E. Shaw Research.\n\
All rights reserved.\n\
@@ -712,6 +716,7 @@ threefry2x32 (threefry2x32_ctr_t in, threefry2x32_key_t k)\n\
{\n\
return threefry2x32_R (threefry2x32_rounds, in, k);\n\
}\n\
+#endif\n\
\n\
";
ss << "double " << mSymName << "_Random (int seed)\n\