From 7c9e37031eec25016696bc0cf3a5554ed71d268d Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Fri, 17 Apr 2020 15:36:32 +0200 Subject: [PATCH] added missing MAXMDIM guards in fieldpattern --- fieldpattern.cpp | 14 +++++++------- geom-exp.cpp | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/fieldpattern.cpp b/fieldpattern.cpp index 4639abd6..c1361d43 100644 --- a/fieldpattern.cpp +++ b/fieldpattern.cpp @@ -284,7 +284,7 @@ struct fpattern { fpattern(int p) { force_hash = 0; - #if CAP_THREAD + #if CAP_THREAD && MAXMDIM >= 4 dis = nullptr; #endif if(!p) return; @@ -317,7 +317,7 @@ struct fpattern { #endif }; -#if CAP_THREAD +#if CAP_THREAD && MAXMDIM >= 4 struct discovery { fpattern experiment; std::shared_ptr discoverer; @@ -404,7 +404,7 @@ vector fpattern::generate_isometries3() { for(T[3][1]=low; T[3][1]= 4 if(dis) dis->check_suspend(); if(dis && dis->stop_it) return res; #endif @@ -528,7 +528,7 @@ int fpattern::solve3() { for(auto& xX: possible_X) for(auto& xP: possible_P) if(check_order(mmul(xP, xX), cgi.xp_order)) for(auto& xR: possible_R) if(check_order(mmul(xR, xX), cgi.rx_order)) { // if(xR[0][0] == 1 && xR[0][1] == 0) - #if CAP_THREAD + #if CAP_THREAD && MAXMDIM >+ 4 if(dis) dis->check_suspend(); if(dis && dis->stop_it) return 0; #endif @@ -542,7 +542,7 @@ int fpattern::solve3() { } P = xP; R = xR; X = xX; if(!generate_all3()) continue; - #if CAP_THREAD + #if CAP_THREAD && MAXMDIM >= 4 if(dis) { dis->discovered(); continue; } #endif if(force_hash && compute_hash() != force_hash) continue; @@ -1254,7 +1254,7 @@ EX void field_from_current() { fieldpattern::quotient_field_changed = true; } -#if CAP_THREAD +#if CAP_THREAD && MAXMDIM >= 4 EX map discoveries; void discovery::activate() { @@ -1294,7 +1294,7 @@ discovery::~discovery() { schedule_destruction(); if(discoverer) discoverer->joi #endif int hk = -#if CAP_THREAD +#if CAP_THREAD && MAXMDIM >= 4 + addHook(on_geometry_change, 100, [] { for(auto& d:discoveries) if(!d.second.is_suspended) d.second.suspend(); }) + addHook(final_cleanup, 100, [] { for(auto& d:discoveries) { d.second.schedule_destruction(); if(d.second.is_suspended) d.second.activate(); } diff --git a/geom-exp.cpp b/geom-exp.cpp index 53581ca1..af582e25 100644 --- a/geom-exp.cpp +++ b/geom-exp.cpp @@ -405,7 +405,7 @@ EX string dim_name() { return " (" + its(WDIM) + "D)"; } -#if CAP_THREAD +#if CAP_THREAD && MAXMDIM >= 4 EX void showQuotientConfig3() { using namespace fieldpattern; @@ -528,7 +528,7 @@ EX void select_quotient_screen() { println(hlog, "set prime = ", currfp.Prime); start_game(); } - #if CAP_THREAD + #if CAP_THREAD && MAXMDIM >= 4 pushScreen(showQuotientConfig3); #endif }