2017-03-08 00:00:26 +01:00
|
|
|
From 0f0be88526ece7d2f6ee21c1f59b1546ec6dc7c0 Mon Sep 17 00:00:00 2001
|
|
|
|
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
|
|
|
|
Date: Tue, 7 Mar 2017 22:25:14 +0100
|
|
|
|
Subject: [PATCH] sqlite3: fix build when threads are not used/available
|
2014-07-12 14:11:52 +02:00
|
|
|
|
|
|
|
When threads are not used/available, a function in the sqlite3 extension
|
|
|
|
ends up with a label at the end:
|
|
|
|
|
|
|
|
void _pysqlite_final_callback(sqlite3_context* context)
|
|
|
|
{
|
|
|
|
PyObject* function_result;
|
|
|
|
PyObject** aggregate_instance;
|
|
|
|
int ok;
|
|
|
|
|
|
|
|
#ifdef WITH_THREAD
|
|
|
|
PyGILState_STATE threadstate;
|
|
|
|
|
|
|
|
threadstate = PyGILState_Ensure();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
aggregate_instance = (PyObject**)sqlite3_aggregate_context(context, sizeof(PyObject*));
|
|
|
|
if (!*aggregate_instance) {
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
|
|
|
[......]
|
|
|
|
|
|
|
|
error:
|
|
|
|
#ifdef WITH_THREAD
|
|
|
|
PyGILState_Release(threadstate);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
This is not valid, and gcc complains.
|
|
|
|
|
|
|
|
Fix that by adding a dummy statement after the label, so that the label
|
|
|
|
is never the last statement of the function.
|
|
|
|
|
|
|
|
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
|
2017-03-08 00:00:26 +01:00
|
|
|
---
|
|
|
|
Modules/_sqlite/connection.c | 1 +
|
|
|
|
1 file changed, 1 insertion(+)
|
2014-07-12 14:11:52 +02:00
|
|
|
|
2017-03-08 00:00:26 +01:00
|
|
|
diff --git a/Modules/_sqlite/connection.c b/Modules/_sqlite/connection.c
|
|
|
|
index 237d6e4..cdf69ab 100644
|
2014-12-28 21:54:54 +01:00
|
|
|
--- a/Modules/_sqlite/connection.c
|
|
|
|
+++ b/Modules/_sqlite/connection.c
|
2017-03-08 00:00:26 +01:00
|
|
|
@@ -794,6 +794,7 @@ error:
|
2014-07-12 14:11:52 +02:00
|
|
|
#ifdef WITH_THREAD
|
|
|
|
PyGILState_Release(threadstate);
|
|
|
|
#endif
|
|
|
|
+ ; /* Make gcc happy: a label can't be at the end of a function */
|
|
|
|
}
|
|
|
|
|
|
|
|
static void _pysqlite_drop_unused_statement_references(pysqlite_Connection* self)
|
2017-03-08 00:00:26 +01:00
|
|
|
--
|
|
|
|
2.7.4
|
|
|
|
|