From 11439eabfc41e8e1a5aed2106eaa70d697b1df59 Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Tue, 23 Apr 2019 15:08:51 -0700 Subject: [PATCH] Fabric: Using `#ifndef NDEBUG` instead of `#ifdef DEBUG` Summary: Trivial. Apparently, `DEBUG` is non-standard feature and using `assert` with `DEBUG` is practically asking for bugs. So, if your `assert` relies on some variable which is only defined when `DEBUG` is set, it's easy to get invalid code because NDEBUG and DEBUG can be unsync. So, we have to use clunky double negative `#ifndef NDEBUG` everywhere where we used DEBUG. Reviewed By: JoshuaGross Differential Revision: D15031328 fbshipit-source-id: 036f573e68925741ca46384261885766c87db1e3 --- ReactCommon/fabric/mounting/ShadowTree.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReactCommon/fabric/mounting/ShadowTree.h b/ReactCommon/fabric/mounting/ShadowTree.h index cc328c4195a..9a87e55d86a 100644 --- a/ReactCommon/fabric/mounting/ShadowTree.h +++ b/ReactCommon/fabric/mounting/ShadowTree.h @@ -5,7 +5,7 @@ #pragma once -#ifdef DEBUG +#ifndef NDEBUG #define RN_SHADOW_TREE_INTROSPECTION #endif