diff options
author | Tor Lillqvist <tml@collabora.com> | 2015-02-08 11:04:13 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-02-09 09:43:12 +0000 |
commit | 87dc0ee13feb8f1d6031ac77465141b9636c18d6 (patch) | |
tree | 02738fc7b7aedc81cd7c3d3d02f7ef1e6f14b6d0 /sc/source/core | |
parent | 72812676b419b8d5fa32d06e5c45af73d08eac59 (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
Reviewed-on: https://gerrit.libreoffice.org/14366
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc/source/core')
-rw-r--r-- | sc/source/core/opencl/formulagroupcl.cxx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx index 948b4ab1d331..134887664a4e 100644 --- a/sc/source/core/opencl/formulagroupcl.cxx +++ b/sc/source/core/opencl/formulagroupcl.cxx @@ -336,6 +336,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\ @@ -633,6 +637,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\ |