From be0fad506e28d072e3454091c1bb1101bfbca368 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Thu, 11 Jul 2019 14:04:49 -0700 Subject: [PATCH] ircd::ctx: Move macro condition to internal header. --- ircd/ctx.cc | 10 ---------- ircd/ctx.h | 10 ++++++++++ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ircd/ctx.cc b/ircd/ctx.cc index e3570f643..58591ab7a 100644 --- a/ircd/ctx.cc +++ b/ircd/ctx.cc @@ -12,16 +12,6 @@ #include #include "ctx.h" -/// We make a special use of the stack-protector canary in certain places as -/// another tool to detect corruption of a context's stack, specifically -/// during yield and resume. This use is not really to provide security; just -/// a kind of extra assertion, so we eliminate its emission during release. -#if !defined(NDEBUG) && !defined(__clang__) - #define IRCD_CTX_STACK_PROTECT __attribute__((stack_protect)) -#else - #define IRCD_CTX_STACK_PROTECT -#endif - /// Instance list linkage for the list of all ctx instances. template<> decltype(ircd::util::instance_list::allocator) diff --git a/ircd/ctx.h b/ircd/ctx.h index 1c43f479d..800314388 100644 --- a/ircd/ctx.h +++ b/ircd/ctx.h @@ -8,6 +8,16 @@ // copyright notice and this permission notice is present in all copies. The // full license for this software is available in the LICENSE file. +/// We make a special use of the stack-protector canary in certain places as +/// another tool to detect corruption of a context's stack, specifically +/// during yield and resume. This use is not really to provide security; just +/// a kind of extra assertion, so we eliminate its emission during release. +#if !defined(NDEBUG) && !defined(__clang__) + #define IRCD_CTX_STACK_PROTECT __attribute__((stack_protect)) +#else + #define IRCD_CTX_STACK_PROTECT +#endif + namespace ircd::ctx { struct stack;