Skip to content

Commit 408027e

Browse files
committed
Rename DEBUG macro to Py_DEBUG
1 parent a0dc1c4 commit 408027e

File tree

11 files changed

+23
-23
lines changed

11 files changed

+23
-23
lines changed

Include/frameobject.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ PyFrameObject * PyFrame_New
8080

8181
/* Tuple access macros */
8282

83-
#ifndef DEBUG
83+
#ifndef Py_DEBUG
8484
#define GETITEM(v, i) PyTuple_GET_ITEM((PyTupleObject *)(v), (i))
8585
#define GETITEMNAME(v, i) \
8686
PyString_AS_STRING((PyStringObject *)GETITEM((v), (i)))

Include/node.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ extern void PyNode_Free Py_PROTO((node *n));
5656
#define STR(n) ((n)->n_str)
5757

5858
/* Assert that the type of a node is what we expect */
59-
#ifndef DEBUG
59+
#ifndef Py_DEBUG
6060
#define REQ(n, type) { /*pass*/ ; }
6161
#else
6262
#define REQ(n, type) \

Include/object.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,15 @@ whose size is determined when the object is allocated.
8484
123456789-123456789-123456789-123456789-123456789-123456789-123456789-12
8585
*/
8686

87-
#ifdef DEBUG
87+
#ifdef Py_DEBUG
8888

8989
/* Turn on heavy reference debugging */
9090
#define Py_TRACE_REFS
9191

9292
/* Turn on reference counting */
9393
#define Py_REF_DEBUG
9494

95-
#endif /* DEBUG */
95+
#endif /* Py_DEBUG */
9696

9797
#ifdef Py_TRACE_REFS
9898
#define PyObject_HEAD \

Parser/acceler.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,14 @@ addaccelerators(g)
5656
{
5757
dfa *d;
5858
int i;
59-
#ifdef DEBUG
59+
#ifdef Py_DEBUG
6060
fprintf(stderr, "Adding parser accelerators ...\n");
6161
#endif
6262
d = g->g_dfa;
6363
for (i = g->g_ndfas; --i >= 0; d++)
6464
fixdfa(g, d);
6565
g->g_accel = 1;
66-
#ifdef DEBUG
66+
#ifdef Py_DEBUG
6767
fprintf(stderr, "Done.\n");
6868
#endif
6969
}

Parser/grammar.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ translatelabels(g)
171171
{
172172
int i;
173173

174-
#ifdef DEBUG
174+
#ifdef Py_DEBUG
175175
printf("Translating labels ...\n");
176176
#endif
177177
/* Don't translate EMPTY */

Parser/parser.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ PERFORMANCE OF THIS SOFTWARE.
4444
#include "errcode.h"
4545

4646

47-
#ifdef DEBUG
47+
#ifdef Py_DEBUG
4848
extern int debugging;
4949
#define D(x) if (!debugging); else x
5050
#else
@@ -85,7 +85,7 @@ s_push(s, d, parent)
8585
return 0;
8686
}
8787

88-
#ifdef DEBUG
88+
#ifdef Py_DEBUG
8989

9090
static void s_pop PROTO((stack *));
9191

@@ -98,7 +98,7 @@ s_pop(s)
9898
s->s_top++;
9999
}
100100

101-
#else /* !DEBUG */
101+
#else /* !Py_DEBUG */
102102

103103
#define s_pop(s) (s)->s_top++
104104

@@ -309,7 +309,7 @@ addtoken(ps, type, str, lineno)
309309
}
310310

311311

312-
#ifdef DEBUG
312+
#ifdef Py_DEBUG
313313

314314
/* DEBUG OUTPUT */
315315

@@ -379,7 +379,7 @@ printtree(ps)
379379
printf("\n");
380380
}
381381

382-
#endif /* DEBUG */
382+
#endif /* Py_DEBUG */
383383

384384
/*
385385

Parser/pgen.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ addnfa(gr, name)
166166
return nf;
167167
}
168168

169-
#ifdef DEBUG
169+
#ifdef Py_DEBUG
170170

171171
static char REQNFMT[] = "metacompile: less than %d children\n";
172172

Parser/tokenizer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,7 @@ tok_get(tok, p_start, p_end)
736736
}
737737

738738

739-
#ifdef DEBUG
739+
#ifdef Py_DEBUG
740740

741741
void
742742
tok_dump(type, start, end)

Python/ceval.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ PERFORMANCE OF THIS SOFTWARE.
5151
/* Turn this on if your compiler chokes on the big switch: */
5252
/* #define CASE_TOO_BIG 1 */
5353

54-
#ifdef DEBUG
54+
#ifdef Py_DEBUG
5555
/* For debugging the interpreter: */
5656
#define LLTRACE 1 /* Low-level trace feature */
5757
#define CHECKEXC 1 /* Double-check exception checking */
@@ -339,7 +339,7 @@ eval_code2(co, globals, locals,
339339
#ifdef LLTRACE
340340
int lltrace;
341341
#endif
342-
#if defined(DEBUG) || defined(LLTRACE)
342+
#if defined(Py_DEBUG) || defined(LLTRACE)
343343
/* Make it easier to find out where we are with a debugger */
344344
char *filename = getstringvalue(co->co_filename);
345345
#endif
@@ -602,7 +602,7 @@ eval_code2(co, globals, locals,
602602

603603
/* Extract opcode and argument */
604604

605-
#if defined(DEBUG) || defined(LLTRACE)
605+
#if defined(Py_DEBUG) || defined(LLTRACE)
606606
f->f_lasti = INSTR_OFFSET();
607607
#endif
608608

Python/thread.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ extern char *getenv();
8383
#define _P2(v1,t1,v2,t2) (v1,v2) t1; t2;
8484
#endif /* __STDC__ */
8585

86-
#ifdef DEBUG
86+
#ifdef Py_DEBUG
8787
static int thread_debug = 0;
8888
#define dprintf(args) ((thread_debug & 1) && printf args)
8989
#define d2printf(args) ((thread_debug & 8) && printf args)
@@ -98,7 +98,7 @@ static void _init_thread(); /* Forward */
9898

9999
void init_thread _P0()
100100
{
101-
#ifdef DEBUG
101+
#ifdef Py_DEBUG
102102
char *p = getenv("THREADDEBUG");
103103

104104
if (p) {
@@ -107,7 +107,7 @@ void init_thread _P0()
107107
else
108108
thread_debug = 1;
109109
}
110-
#endif /* DEBUG */
110+
#endif /* Py_DEBUG */
111111
if (initialized)
112112
return;
113113
initialized = 1;

0 commit comments

Comments
 (0)