Skip to content

Commit

Permalink
Fabric: Using #ifndef NDEBUG instead of #ifdef DEBUG
Browse files Browse the repository at this point in the history
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
Rate limit · GitHub

Access has been restricted

You have triggered a rate limit.

Please wait a few minutes before you try again;
in some cases this may take up to an hour.

shergin authored and facebook-github-bot committed Apr 23, 2019
1 parent 2c0af4b commit 11439ea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ReactCommon/fabric/mounting/ShadowTree.h
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@

#pragma once

#ifdef DEBUG
#ifndef NDEBUG
#define RN_SHADOW_TREE_INTROSPECTION
#endif

0 comments on commit 11439ea

Please sign in to comment.