From aacd468c054df93d287855e345d54ca7b2a42cb2 Mon Sep 17 00:00:00 2001 From: Leo Yuriev Date: Fri, 27 Jan 2017 19:24:43 +0300 Subject: [PATCH] mdbx: check __OPTIMIZE__ for __hot/__cold/__flatten. --- reopen.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reopen.h b/reopen.h index 72f8e3ad..dd214172 100644 --- a/reopen.h +++ b/reopen.h @@ -57,7 +57,7 @@ #endif /* __must_check_result */ #ifndef __hot -# if defined(NDEBUG) && (defined(__GNUC__) && !defined(__clang__)) +# if defined(__OPTIMIZE__) && (defined(__GNUC__) && !defined(__clang__)) # define __hot __attribute__((hot, optimize("O3"))) # elif defined(__GNUC__) /* cland case, just put frequently used functions in separate section */ @@ -68,7 +68,7 @@ #endif /* __hot */ #ifndef __cold -# if defined(NDEBUG) && (defined(__GNUC__) && !defined(__clang__)) +# if defined(__OPTIMIZE__) && (defined(__GNUC__) && !defined(__clang__)) # define __cold __attribute__((cold, optimize("Os"))) # elif defined(__GNUC__) /* cland case, just put infrequently used functions in separate section */ @@ -79,7 +79,7 @@ #endif /* __cold */ #ifndef __flatten -# if defined(NDEBUG) && (defined(__GNUC__) || defined(__clang__)) +# if defined(__OPTIMIZE__) && (defined(__GNUC__) || defined(__clang__)) # define __flatten __attribute__((flatten)) # else # define __flatten