Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 42e3055

Browse files
committed
Merged revisions 75440 via svnmerge from
svn+ssh://[email protected]/python/trunk ........ r75440 | mark.dickinson | 2009-10-15 18:45:39 +0100 (Thu, 15 Oct 2009) | 1 line Allow core Python build to succeed under WITHOUT_COMPLEX. The module build stage still fails. ........
1 parent ffecdb1 commit 42e3055

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

Python/compile.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -895,10 +895,8 @@ compiler_add_o(struct compiler *c, PyObject *dict, PyObject *o)
895895
{
896896
PyObject *t, *v;
897897
Py_ssize_t arg;
898-
unsigned char *p, *q;
899-
Py_complex z;
898+
unsigned char *p;
900899
double d;
901-
int real_part_zero, imag_part_zero;
902900

903901
/* necessary to make sure types aren't coerced (e.g., int and long) */
904902
/* _and_ to distinguish 0.0 from -0.0 e.g. on IEEE platforms */
@@ -913,7 +911,11 @@ compiler_add_o(struct compiler *c, PyObject *dict, PyObject *o)
913911
else
914912
t = PyTuple_Pack(2, o, o->ob_type);
915913
}
914+
#ifndef WITHOUT_COMPLEX
916915
else if (PyComplex_Check(o)) {
916+
Py_complex z;
917+
int real_part_zero, imag_part_zero;
918+
unsigned char *q;
917919
/* complex case is even messier: we need to make complex(x,
918920
0.) different from complex(x, -0.) and complex(0., y)
919921
different from complex(-0., y), for any x and y. In
@@ -943,6 +945,7 @@ compiler_add_o(struct compiler *c, PyObject *dict, PyObject *o)
943945
t = PyTuple_Pack(2, o, o->ob_type);
944946
}
945947
}
948+
#endif /* WITHOUT_COMPLEX */
946949
else {
947950
t = PyTuple_Pack(2, o, o->ob_type);
948951
}

Python/formatter_unicode.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
#define FORMAT_STRING _PyUnicode_FormatAdvanced
1010
#define FORMAT_LONG _PyLong_FormatAdvanced
1111
#define FORMAT_FLOAT _PyFloat_FormatAdvanced
12+
#ifndef WITHOUT_COMPLEX
1213
#define FORMAT_COMPLEX _PyComplex_FormatAdvanced
14+
#endif
1315

1416
#include "../Objects/stringlib/formatter.h"

0 commit comments

Comments
 (0)