summaryrefslogtreecommitdiffstats
path: root/Modules/_sqlite
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2016-09-06 00:44:18 (GMT)
committerBenjamin Peterson <benjamin@python.org>2016-09-06 00:44:18 (GMT)
commited4aa83ff77ff11059f64dab711adf35ce9d0e0f (patch)
treecf430f6a641782d7c794c1adc73c055a3f120a69 /Modules/_sqlite
parentb3b0767861c69115a1482e3ade8d29207e204b15 (diff)
downloadcpython-ed4aa83ff77ff11059f64dab711adf35ce9d0e0f.zip
cpython-ed4aa83ff77ff11059f64dab711adf35ce9d0e0f.tar.gz
cpython-ed4aa83ff77ff11059f64dab711adf35ce9d0e0f.tar.bz2
require a long long data type (closes #27961)
Diffstat (limited to 'Modules/_sqlite')
-rw-r--r--Modules/_sqlite/util.c19
1 files changed, 0 insertions, 19 deletions
diff --git a/Modules/_sqlite/util.c b/Modules/_sqlite/util.c
index 312fe3b..a276dad 100644
--- a/Modules/_sqlite/util.c
+++ b/Modules/_sqlite/util.c
@@ -113,7 +113,6 @@ int _pysqlite_seterror(sqlite3* db, sqlite3_stmt* st)
PyObject *
_pysqlite_long_from_int64(sqlite_int64 value)
{
-#ifdef HAVE_LONG_LONG
# if SIZEOF_LONG_LONG < 8
if (value > PY_LLONG_MAX || value < PY_LLONG_MIN) {
return _PyLong_FromByteArray(&value, sizeof(value),
@@ -124,14 +123,6 @@ _pysqlite_long_from_int64(sqlite_int64 value)
if (value > LONG_MAX || value < LONG_MIN)
return PyLong_FromLongLong(value);
# endif
-#else
-# if SIZEOF_LONG < 8
- if (value > LONG_MAX || value < LONG_MIN) {
- return _PyLong_FromByteArray(&value, sizeof(value),
- IS_LITTLE_ENDIAN, 1 /* signed */);
- }
-# endif
-#endif
return PyLong_FromLong(Py_SAFE_DOWNCAST(value, sqlite_int64, long));
}
@@ -139,23 +130,13 @@ sqlite_int64
_pysqlite_long_as_int64(PyObject * py_val)
{
int overflow;
-#ifdef HAVE_LONG_LONG
PY_LONG_LONG value = PyLong_AsLongLongAndOverflow(py_val, &overflow);
-#else
- long value = PyLong_AsLongAndOverflow(py_val, &overflow);
-#endif
if (value == -1 && PyErr_Occurred())
return -1;
if (!overflow) {
-#ifdef HAVE_LONG_LONG
# if SIZEOF_LONG_LONG > 8
if (-0x8000000000000000LL <= value && value <= 0x7FFFFFFFFFFFFFFFLL)
# endif
-#else
-# if SIZEOF_LONG > 8
- if (-0x8000000000000000L <= value && value <= 0x7FFFFFFFFFFFFFFFL)
-# endif
-#endif
return value;
}
else if (sizeof(value) < sizeof(sqlite_int64)) {