openocd: avoid documentation rebuild to fix build issues
[buildroot-gz.git] / package / python / 015-fix-sqlite-without-threads.patch
blobf51c37b372519eee7cbf05bbe3c5c085482edad1
1 sqlite3: fix build when threads are not used/available
3 When threads are not used/available, a function in the sqlite3 extension
4 ends up with a label at the end:
6 void _pysqlite_final_callback(sqlite3_context* context)
8 PyObject* function_result;
9 PyObject** aggregate_instance;
10 int ok;
12 #ifdef WITH_THREAD
13 PyGILState_STATE threadstate;
15 threadstate = PyGILState_Ensure();
16 #endif
18 aggregate_instance = (PyObject**)sqlite3_aggregate_context(context, sizeof(PyObject*));
19 if (!*aggregate_instance) {
20 goto error;
23 [......]
25 error:
26 #ifdef WITH_THREAD
27 PyGILState_Release(threadstate);
28 #endif
31 This is not valid, and gcc complains.
33 Fix that by adding a dummy statement after the label, so that the label
34 is never the last statement of the function.
36 Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
38 Index: b/Modules/_sqlite/connection.c
39 ===================================================================
40 --- a/Modules/_sqlite/connection.c
41 +++ b/Modules/_sqlite/connection.c
42 @@ -786,6 +786,7 @@
43 #ifdef WITH_THREAD
44 PyGILState_Release(threadstate);
45 #endif
46 + ; /* Make gcc happy: a label can't be at the end of a function */
49 static void _pysqlite_drop_unused_statement_references(pysqlite_Connection* self)