Skip to content

Commit 5f99fa7

Browse files
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.
2 parents 1f6ee73 + d160b12 commit 5f99fa7

4 files changed

Lines changed: 10 additions & 7 deletions

File tree

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ What's New in Python 3.4.0 Alpha 1?
1010
Core and Builtins
1111
-----------------
1212

13+
- Issue #17857: Prevent build failures with pre-3.5.0 versions of sqlite3,
14+
such as was shipped with Centos 5 and Mac OS X 10.4.
15+
1316
- Issue #17413: sys.settrace callbacks were being passed a string instead of an
1417
exception instance for the 'value' element of the arg tuple if the exception
1518
originated from C code; now an exception instance is always provided.

Modules/_sqlite/cursor.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,7 @@ PyObject* _pysqlite_query_execute(pysqlite_Cursor* self, int multiple, PyObject*
701701

702702
Py_DECREF(self->lastrowid);
703703
if (!multiple && statement_type == STATEMENT_INSERT) {
704-
sqlite3_int64 lastrowid;
704+
sqlite_int64 lastrowid;
705705
Py_BEGIN_ALLOW_THREADS
706706
lastrowid = sqlite3_last_insert_rowid(self->connection->db);
707707
Py_END_ALLOW_THREADS

Modules/_sqlite/util.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ int _pysqlite_seterror(sqlite3* db, sqlite3_stmt* st)
111111
#endif
112112

113113
PyObject *
114-
_pysqlite_long_from_int64(sqlite3_int64 value)
114+
_pysqlite_long_from_int64(sqlite_int64 value)
115115
{
116116
#ifdef HAVE_LONG_LONG
117117
# if SIZEOF_LONG_LONG < 8
@@ -135,7 +135,7 @@ _pysqlite_long_from_int64(sqlite3_int64 value)
135135
return PyLong_FromLong(value);
136136
}
137137

138-
sqlite3_int64
138+
sqlite_int64
139139
_pysqlite_long_as_int64(PyObject * py_val)
140140
{
141141
int overflow;
@@ -158,8 +158,8 @@ _pysqlite_long_as_int64(PyObject * py_val)
158158
#endif
159159
return value;
160160
}
161-
else if (sizeof(value) < sizeof(sqlite3_int64)) {
162-
sqlite3_int64 int64val;
161+
else if (sizeof(value) < sizeof(sqlite_int64)) {
162+
sqlite_int64 int64val;
163163
if (_PyLong_AsByteArray((PyLongObject *)py_val,
164164
(unsigned char *)&int64val, sizeof(int64val),
165165
IS_LITTLE_ENDIAN, 1 /* signed */) >= 0) {

Modules/_sqlite/util.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ int pysqlite_step(sqlite3_stmt* statement, pysqlite_Connection* connection);
3636
*/
3737
int _pysqlite_seterror(sqlite3* db, sqlite3_stmt* st);
3838

39-
PyObject * _pysqlite_long_from_int64(sqlite3_int64 value);
40-
sqlite3_int64 _pysqlite_long_as_int64(PyObject * value);
39+
PyObject * _pysqlite_long_from_int64(sqlite_int64 value);
40+
sqlite_int64 _pysqlite_long_as_int64(PyObject * value);
4141

4242
#endif

0 commit comments

Comments
 (0)