Skip to content

Commit d194757

Browse files
author
Anselm Kruis
committed
Stackless issue python#205: fix building with STACKLESS_OFF
The recent changes broke building with STACKLESS_OFF (Usually $ make CFLAGS=-DSTACKLESS_OFF). Now it works again.
1 parent 34768b4 commit d194757

File tree

4 files changed

+23
-18
lines changed

4 files changed

+23
-18
lines changed

Modules/_asynciomodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2546,13 +2546,13 @@ static PyStacklessFunctionDeclarationObject task_step_impl_declaration = {
25462546
static PyObject *
25472547
task_step_impl_part1(TaskObj *task, PyObject *exc, int *failed)
25482548
{
2549-
STACKLESS_GETARG();
25502549
#else /* #ifdef STACKLESS */
25512550

25522551
static PyObject *
25532552
task_step_impl(TaskObj *task, PyObject *exc)
25542553
{
25552554
#endif /* #ifdef STACKLESS */
2555+
STACKLESS_GETARG();
25562556
int res;
25572557
int clear_exc = 0;
25582558
PyObject *result = NULL;

Stackless/core/stackless_impl.h

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@
33

44
#include "Python.h"
55

6-
#ifdef __cplusplus
7-
extern "C" {
8-
#endif
9-
10-
#ifdef STACKLESS
11-
126
#if defined(Py_BUILD_CORE) && !defined(SLP_BUILD_CORE)
137
#define SLP_BUILD_CORE
148
#endif
159

1610
#include "stackless_api.h"
1711

12+
#ifdef __cplusplus
13+
extern "C" {
14+
#endif
15+
16+
#ifdef STACKLESS
17+
1818
#ifdef SLP_BUILD_CORE
1919

2020
#ifdef Py_BUILD_CORE
@@ -781,6 +781,8 @@ long slp_parse_thread_id(PyObject *thread_id, unsigned long *id);
781781
#define SLP_PEEK_NEXT_FRAME(tstate) \
782782
((tstate)->frame)
783783

784+
#define STACKLESS_PROMOTE_WRAPPER(descr) assert(1)
785+
784786
#define STACKLESS_PROPOSE(tstate, func) assert(1)
785787
#define STACKLESS_PROPOSE_FLAG(tstate, flag) assert(1)
786788
#define STACKLESS_PROPOSE_ALL(tstate) assert(1)

Stackless/pickling/prickelpit.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#ifdef __cplusplus
44
extern "C" {
55
#endif
6+
#ifdef STACKLESS
67

78
/******************************************************
89
@@ -66,7 +67,7 @@ int slp_safe_pickling(int(*save)(PyObject *, PyObject *, int),
6667
int pers_save);
6768

6869

69-
70+
#endif /* STACKLESS */
7071
#ifdef __cplusplus
7172
}
7273
#endif

Stackless/stackless_api.h

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -468,16 +468,6 @@ STACKLESS_RETRACT()
468468
#define STACKLESS_PROMOTE_FLAG(flag) \
469469
(stackless ? (_PyStackless_TRY_STACKLESS = (flag)) : 0)
470470

471-
#define STACKLESS_PROMOTE_METHOD(obj, slot_name) \
472-
STACKLESS_PROMOTE_FLAG( \
473-
(Py_TYPE(obj)->tp_flags & Py_TPFLAGS_HAVE_STACKLESS_EXTENSION) && \
474-
Py_TYPE(obj)->tp_as_mapping && \
475-
Py_TYPE(obj)->tp_as_mapping->slpflags.slot_name)
476-
477-
#define STACKLESS_PROMOTE(obj) \
478-
STACKLESS_PROMOTE_FLAG( \
479-
Py_TYPE(obj)->tp_flags & Py_TPFLAGS_HAVE_STACKLESS_CALL)
480-
481471
#define STACKLESS_RETRACT() (_PyStackless_TRY_STACKLESS = 0)
482472

483473
#define STACKLESS_ASSERT() assert(!_PyStackless_TRY_STACKLESS)
@@ -490,6 +480,18 @@ STACKLESS_RETRACT()
490480
#define STACKLESS_RETRACT() assert(1)
491481
#define STACKLESS_ASSERT() assert(1)
492482
#endif
483+
484+
#define STACKLESS_PROMOTE_METHOD(obj, slot_name) \
485+
STACKLESS_PROMOTE_FLAG( \
486+
(Py_TYPE(obj)->tp_flags & Py_TPFLAGS_HAVE_STACKLESS_EXTENSION) && \
487+
Py_TYPE(obj)->tp_as_mapping && \
488+
Py_TYPE(obj)->tp_as_mapping->slpflags.slot_name)
489+
490+
#define STACKLESS_PROMOTE(obj) \
491+
STACKLESS_PROMOTE_FLAG( \
492+
Py_TYPE(obj)->tp_flags & Py_TPFLAGS_HAVE_STACKLESS_CALL)
493+
494+
493495
#ifdef STACKLESS
494496

495497
/******************************************************

0 commit comments

Comments
 (0)