py: Check for NDEBUG using #ifdef rather than #if.

Defining NDEBUG (to any value, even 0) disables debugging.  Otherwise,
if it's not defined, debugging is enabled.
pull/1089/head
Damien George 2015-01-25 18:35:54 +00:00
rodzic 17d299b7bd
commit 8788b131ec
2 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -56,7 +56,7 @@ const char *mp_obj_get_type_str(mp_const_obj_t o_in) {
void mp_obj_print_helper(void (*print)(void *env, const char *fmt, ...), void *env, mp_obj_t o_in, mp_print_kind_t kind) {
// There can be data structures nested too deep, or just recursive
MP_STACK_CHECK();
#if !NDEBUG
#ifndef NDEBUG
if (o_in == NULL) {
print(env, "(nil)");
return;

Wyświetl plik

@ -61,7 +61,7 @@ typedef struct _mp_obj_base_t mp_obj_base_t;
// For debugging purposes they are all different. For non-debug mode, we alias
// as many as we can to MP_OBJ_NULL because it's cheaper to load/compare 0.
#if NDEBUG
#ifdef NDEBUG
#define MP_OBJ_NULL ((mp_obj_t)0)
#define MP_OBJ_STOP_ITERATION ((mp_obj_t)0)
#define MP_OBJ_SENTINEL ((mp_obj_t)4)