Skip to content

Commit 2f0ce2a

Browse files
stinospfalcon
authored andcommitted
py: Cleanup use of global DEBUG preprocessor definition
The standard preprocessor definition to differentiate debug and non-debug builds is NDEBUG, not DEBUG, so don't rely on the latter: - just delete the use of it in objint_longlong.c as it has been stale code for years anyway (since commit [c4029e5]): SUFFIX isn't used anywhere. - replace DEBUG with MICROPY_DEBUG_NLR in nlr.h: it is rarely used anymore so can be off by default
1 parent a7f5022 commit 2f0ce2a

2 files changed

Lines changed: 1 addition & 9 deletions

File tree

py/nlr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ NORETURN void nlr_jump(void *val);
8585
NORETURN void nlr_jump_fail(void *val);
8686

8787
// use nlr_raise instead of nlr_jump so that debugging is easier
88-
#ifndef DEBUG
88+
#ifndef MICROPY_DEBUG_NLR
8989
#define nlr_raise(val) nlr_jump(MP_OBJ_TO_PTR(val))
9090
#else
9191
#include "mpstate.h"

py/objint_longlong.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,6 @@
4040

4141
#if MICROPY_LONGINT_IMPL == MICROPY_LONGINT_IMPL_LONGLONG
4242

43-
// Python3 no longer has "l" suffix for long ints. We allow to use it
44-
// for debugging purpose though.
45-
#ifdef DEBUG
46-
#define SUFFIX "l"
47-
#else
48-
#define SUFFIX ""
49-
#endif
50-
5143
#if MICROPY_PY_SYS_MAXSIZE
5244
// Export value for sys.maxsize
5345
const mp_obj_int_t mp_maxsize_obj = {{&mp_type_int}, MP_SSIZE_MAX};

0 commit comments

Comments
 (0)