Build: replace Blender specific DEBUG by standard NDEBUG

NDEBUG is part of the C standard and disables asserts. Only this will
now be used to decide if asserts are enabled.

DEBUG was a Blender specific define, that has now been removed.

_DEBUG is a Visual Studio define for builds in Debug configuration.
Blender defines this for all platforms. This is still used in a few
places in the draw code, and in external libraries Bullet and Mantaflow.

Pull Request: https://projects.blender.org/blender/blender/pulls/115774
This commit is contained in:
Brecht Van Lommel
2023-12-04 15:13:06 +01:00
committed by Gitea
parent fc863c63e6
commit e06561a27a
87 changed files with 159 additions and 156 deletions

View File

@@ -1311,7 +1311,7 @@ int curve_fit_cubic_to_points_refit_db(
#ifdef USE_CORNER_DETECT
if (use_corner) {
#ifdef DEBUG
#ifndef NDEBUG
for (uint i = 0; i < knots_len; i++) {
assert(knots[i].heap_node == NULL);
}

View File

@@ -206,7 +206,7 @@ static void rt_node_free(RangeTreeUInt *rt, Node *node);
#ifdef USE_BTREE
#ifdef DEBUG
#ifndef NDEBUG
static bool rb_is_balanced_root(const Node *root);
#endif
@@ -238,7 +238,7 @@ static int key_cmp(uint key1, uint key2)
/* removed from the tree */
static void rb_node_invalidate(Node *node)
{
#ifdef DEBUG
#ifndef NDEBUG
node->left = NULL;
node->right = NULL;
node->color = false;
@@ -481,7 +481,7 @@ static Node *rb_get_or_lower_recursive(Node *n, const uint key)
}
}
#ifdef DEBUG
#ifndef NDEBUG
static bool rb_is_balanced_recursive(const Node *node, int black)
{
@@ -511,7 +511,7 @@ static bool rb_is_balanced_root(const Node *root)
return rb_is_balanced_recursive(root, black);
}
#endif // DEBUG
#endif // NDEBUG
/* End BTree API */
@@ -703,7 +703,7 @@ RangeTreeUInt *range_tree_uint_alloc(uint min, uint max)
void range_tree_uint_free(RangeTreeUInt *rt)
{
#ifdef DEBUG
#ifndef NDEBUG
#ifdef USE_BTREE
assert(rb_is_balanced_root(rt->root));
#endif