mirror of
https://github.com/python/cpython.git
synced 2025-12-15 21:44:50 +00:00
The SSE2 detection and enabling could potentially cause
problems for binary distributions of Python in situations where the build machine has SSE2 but the target machine does not. Therefore, don't enable SSE2 instructions automatically on x86.
This commit is contained in:
parent
153c70f6d7
commit
7abf8d4066
7 changed files with 47 additions and 280 deletions
|
|
@ -15,6 +15,11 @@
|
|||
#define MAX(x, y) ((x) < (y) ? (y) : (x))
|
||||
#define MIN(x, y) ((x) < (y) ? (x) : (y))
|
||||
|
||||
/* ascii character tests (as opposed to locale tests) */
|
||||
#define ISSPACE(c) ((c) == ' ' || (c) == '\f' || (c) == '\n' || \
|
||||
(c) == '\r' || (c) == '\t' || (c) == '\v')
|
||||
#define ISDIGIT(c) ((c) >= '0' && (c) <= '9')
|
||||
|
||||
#ifdef HAVE_IEEEFP_H
|
||||
#include <ieeefp.h>
|
||||
#endif
|
||||
|
|
@ -188,7 +193,7 @@ PyFloat_FromString(PyObject *v)
|
|||
}
|
||||
|
||||
last = s + len;
|
||||
while (*s && isspace(Py_CHARMASK(*s)))
|
||||
while (*s && ISSPACE(Py_CHARMASK(*s)))
|
||||
s++;
|
||||
if (*s == '\0') {
|
||||
PyErr_SetString(PyExc_ValueError, "empty string for float()");
|
||||
|
|
@ -245,7 +250,7 @@ PyFloat_FromString(PyObject *v)
|
|||
}
|
||||
/* Since end != s, the platform made *some* kind of sense out
|
||||
of the input. Trust it. */
|
||||
while (*end && isspace(Py_CHARMASK(*end)))
|
||||
while (*end && ISSPACE(Py_CHARMASK(*end)))
|
||||
end++;
|
||||
if (*end != '\0') {
|
||||
PyOS_snprintf(buffer, sizeof(buffer),
|
||||
|
|
@ -1275,7 +1280,7 @@ float_fromhex(PyObject *cls, PyObject *arg)
|
|||
********************/
|
||||
|
||||
/* leading whitespace and optional sign */
|
||||
while (isspace(Py_CHARMASK(*s)))
|
||||
while (ISSPACE(Py_CHARMASK(*s)))
|
||||
s++;
|
||||
if (*s == '-') {
|
||||
s++;
|
||||
|
|
@ -1299,6 +1304,7 @@ float_fromhex(PyObject *cls, PyObject *arg)
|
|||
s_store = s;
|
||||
if (*s == '0') {
|
||||
s++;
|
||||
if (*s == 'x' || *s == 'X')
|
||||
if (tolower(*s) == (int)'x')
|
||||
s++;
|
||||
else
|
||||
|
|
@ -1345,7 +1351,7 @@ float_fromhex(PyObject *cls, PyObject *arg)
|
|||
exp = 0;
|
||||
|
||||
/* optional trailing whitespace leading to the end of the string */
|
||||
while (isspace(Py_CHARMASK(*s)))
|
||||
while (ISSPACE(Py_CHARMASK(*s)))
|
||||
s++;
|
||||
if (s != s_end)
|
||||
goto parse_error;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue