From 9736c4637587bcfedacf614fd494d0826090f564 Mon Sep 17 00:00:00 2001 From: Nuno Lopes Date: Fri, 8 Mar 2019 11:16:10 +0000 Subject: [PATCH] constify is_threaded if MT is disabled --- src/util/util.cpp | 2 ++ src/util/util.h | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/src/util/util.cpp b/src/util/util.cpp index 59d6d752c..4fb361475 100644 --- a/src/util/util.cpp +++ b/src/util/util.cpp @@ -39,6 +39,7 @@ void set_verbose_stream(std::ostream& str) { g_verbose_stream = &str; } +#ifndef _NO_OMP_ #ifdef _WINDOWS static int g_thread_id = 0; #else @@ -57,6 +58,7 @@ bool is_threaded() { #endif return g_is_threaded; } +#endif std::ostream& verbose_stream() { return *g_verbose_stream; diff --git a/src/util/util.h b/src/util/util.h index 0ca02bc84..9bc4f8a41 100644 --- a/src/util/util.h +++ b/src/util/util.h @@ -174,7 +174,11 @@ void set_verbosity_level(unsigned lvl); unsigned get_verbosity_level(); std::ostream& verbose_stream(); void set_verbose_stream(std::ostream& str); +#ifdef _NO_OMP_ +# define is_threaded() false +#else bool is_threaded(); +#endif #define IF_VERBOSE(LVL, CODE) { \