summaryrefslogtreecommitdiff
path: root/src/localconsts.h
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-04-24 02:11:35 +0300
committerAndrei Karas <akaras@inbox.ru>2015-04-24 02:13:45 +0300
commitc5e54ca6234d9568e1185e1ff92f4d04c41faa6c (patch)
treeed5a86099956c00753d410dc637388480971a808 /src/localconsts.h
parent4e6c08b939fbfb1cd4a8a5653bd16d285b55150c (diff)
downloadmanaplus-c5e54ca6234d9568e1185e1ff92f4d04c41faa6c.tar.gz
manaplus-c5e54ca6234d9568e1185e1ff92f4d04c41faa6c.tar.bz2
manaplus-c5e54ca6234d9568e1185e1ff92f4d04c41faa6c.tar.xz
manaplus-c5e54ca6234d9568e1185e1ff92f4d04c41faa6c.zip
Add configure option for enable/disable CilkPlus support.
By default disabled.
Diffstat (limited to 'src/localconsts.h')
-rw-r--r--src/localconsts.h25
1 files changed, 22 insertions, 3 deletions
diff --git a/src/localconsts.h b/src/localconsts.h
index 1c43ebc58..4c4827d70 100644
--- a/src/localconsts.h
+++ b/src/localconsts.h
@@ -33,6 +33,10 @@
#endif
#endif
+#define GCC_VERSION (__GNUC__ * 10000 \
+ + __GNUC_MINOR__ * 100 \
+ + __GNUC_PATCHLEVEL__)
+
#if !defined(__GXX_EXPERIMENTAL_CXX0X__)
#undef nullptr
#define nullptr 0
@@ -43,9 +47,6 @@
#define A_DELETE(func)
#define A_DELETE_COPY(func)
#else
-#define GCC_VERSION (__GNUC__ * 10000 \
- + __GNUC_MINOR__ * 100 \
- + __GNUC_PATCHLEVEL__)
#if GCC_VERSION < 40700
#define final
#define override
@@ -80,6 +81,20 @@
#define gnu_printf printf
#endif
+#ifdef __GNUC__
+#ifdef ENABLE_CILKPLUS
+#if GCC_VERSION < 50000
+#define cilk_for for
+#elif GCC_VERSION < 49000
+#define cilk_for for
+#define cilk_spawn
+#endif // GCC_VERSION < 50000
+#else // ENABLE_CILKPLUS
+#define cilk_for for
+#define cilk_spawn
+#endif // ENABLE_CILKPLUS
+#endif // __GNUC__
+
#define notfinal
#define FOR_EACH(type, iter, array) for (type iter = array.begin(), \
@@ -142,3 +157,7 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
+
+#ifdef ENABLE_CILKPLUS
+#include <cilk/cilk.h>
+#endif