From 95e8bbd60f761e5c99e037c38c514be03dbeb3c5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Radek=20Hu=C5=A1ek?= <PitelVonSacek@gmail.com>
Date: Thu, 10 Dec 2015 08:27:11 +0100
Subject: [PATCH] Add REQUIRE construct & new options

Add REQUIRE to define dependencies among compile
time options. Also defines new options USE_TWO_CUTS
and EXPLICIT_NORMAL_EDGES which are unused by now.
---
 compileTimeOptions.h          | 12 +++++++++---
 generateCompileTimeOptions.sh |  4 ++++
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/compileTimeOptions.h b/compileTimeOptions.h
index 5218ac0..4ef5d52 100644
--- a/compileTimeOptions.h
+++ b/compileTimeOptions.h
@@ -5,12 +5,18 @@ BOOL_OPTION(SAVE_MEMORY, 1)
 
 BOOL_OPTION(OPTIMIZED_MAPPINGS, 1)
 
+#ifndef MAX_EDGES
+#define MAX_EDGES 48
+#endif
+
+
 BOOL_OPTION(OPTIMIZE_COMBINE, 0)
 
 BOOL_OPTION(USE_NEXT_FORB, 1)
 
-#ifndef MAX_EDGES
-#define MAX_EDGES 48
-#endif
+BOOL_OPTION(EXPLICIT_NOMAL_EDGES, 0)
+REQUIRES(EXPLICIT_NORMAL_EDGES, USE_NEXT_FORB)
 
+BOOL_OPTION(USE_TWO_CUTS, 0)
+REQUIRES(USE_TWO_CUTS, USE_NEXT_FORB && EXPLICIT_NOMAL_EDGES)
 
diff --git a/generateCompileTimeOptions.sh b/generateCompileTimeOptions.sh
index 19c2de6..fd1c745 100755
--- a/generateCompileTimeOptions.sh
+++ b/generateCompileTimeOptions.sh
@@ -14,6 +14,10 @@ sed -re 's/BOOL_OPTION\((.*), *(.*)\)/#ifndef \1\
 #else\
 #pragma message "\1 off"\
 #endif\
+/;
+s/REQUIRES\((.*), (.*)\)/#if (\1) \&\& !(\2)\
+#error "\1 requires \2"\
+#endif\
 /'
 
 cat <<EOF
-- 
GitLab