]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #17857: Prevent build failures with pre-3.5.0 versions of sqlite3,
authorSerhiy Storchaka <storchaka@gmail.com>
Sun, 28 Apr 2013 11:09:47 +0000 (14:09 +0300)
committerSerhiy Storchaka <storchaka@gmail.com>
Sun, 28 Apr 2013 11:09:47 +0000 (14:09 +0300)
such as was shipped with Centos 5 and Mac OS X 10.4.

This bug was already fixed in issue14572 for 2.7 only and then it was
backported back from 3.3 in issue17073.

Misc/NEWS
Modules/_sqlite/cursor.c
Modules/_sqlite/util.c
Modules/_sqlite/util.h

index cdcf9e5b597b2d86193d41a4ffe6549309d8636a..ef4bc8a42b710180f634d7f8523c4a6dfad7ac25 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -17,6 +17,9 @@ Build
 Core and Builtins
 -----------------
 
+- Issue #17857: Prevent build failures with pre-3.5.0 versions of sqlite3,
+  such as was shipped with Centos 5 and Mac OS X 10.4.
+
 - Issue #17703: Fix a regression where an illegal use of Py_DECREF() after
   interpreter finalization can cause a crash.
 
index ae810dea30b1d6e29397a5ca982619b42f737dd3..f06f92c9c3bd023516ebdd9a6ba5ab02e0eefa49 100644 (file)
@@ -732,7 +732,7 @@ PyObject* _pysqlite_query_execute(pysqlite_Cursor* self, int multiple, PyObject*
 
         Py_DECREF(self->lastrowid);
         if (!multiple && statement_type == STATEMENT_INSERT) {
-            sqlite3_int64 lastrowid;
+            sqlite_int64 lastrowid;
             Py_BEGIN_ALLOW_THREADS
             lastrowid = sqlite3_last_insert_rowid(self->connection->db);
             Py_END_ALLOW_THREADS
index 5f06b66638b8901e60fbe92c3f0d80acaa678b93..a24dd8c634732e7a4b277b8c23ea2b21eb0b28ec 100644 (file)
@@ -111,7 +111,7 @@ int _pysqlite_seterror(sqlite3* db, sqlite3_stmt* st)
 #endif
 
 PyObject *
-_pysqlite_long_from_int64(sqlite3_int64 value)
+_pysqlite_long_from_int64(sqlite_int64 value)
 {
 #ifdef HAVE_LONG_LONG
 # if SIZEOF_LONG_LONG < 8
@@ -135,7 +135,7 @@ _pysqlite_long_from_int64(sqlite3_int64 value)
     return PyInt_FromLong(value);
 }
 
-sqlite3_int64
+sqlite_int64
 _pysqlite_long_as_int64(PyObject * py_val)
 {
     int overflow;
@@ -158,8 +158,8 @@ _pysqlite_long_as_int64(PyObject * py_val)
 #endif
             return value;
     }
-    else if (sizeof(value) < sizeof(sqlite3_int64)) {
-        sqlite3_int64 int64val;
+    else if (sizeof(value) < sizeof(sqlite_int64)) {
+        sqlite_int64 int64val;
         if (_PyLong_AsByteArray((PyLongObject *)py_val,
                                 (unsigned char *)&int64val, sizeof(int64val),
                                 IS_LITTLE_ENDIAN, 1 /* signed */) >= 0) {
index 12a5710ff31f1f535f6f9ee3e4144e908169b1ed..4c3b2c70cb25f26a7f772c7bb2bd3479fc0cd8f8 100644 (file)
@@ -36,7 +36,7 @@ int pysqlite_step(sqlite3_stmt* statement, pysqlite_Connection* connection);
  */
 int _pysqlite_seterror(sqlite3* db, sqlite3_stmt* st);
 
-PyObject * _pysqlite_long_from_int64(sqlite3_int64 value);
-sqlite3_int64 _pysqlite_long_as_int64(PyObject * value);
+PyObject * _pysqlite_long_from_int64(sqlite_int64 value);
+sqlite_int64 _pysqlite_long_as_int64(PyObject * value);
 
 #endif