• Skip to sidebar navigation
  • Skip to content

Bitbucket

  • More
    ProjectsRepositories
  • Help
    • Online help
    • Learn Git
    • Welcome to Bitbucket
    • Keyboard shortcuts
  • Log In
Alexander Dahl
  1. Alexander Dahl

buildroot

Public
Actions
  • Clone
  • Compare

Learn more about cloning repositories

You have read-only access

Navigation
  • Source
  • Commits
  • Branches
  • All Branches Graph
  • Forks
  1. Alexander Dahl
  2. buildroot

Source

buildroot/package/python/015-fix-sqlite-without-threads.patch
Thomas PetazzoniThomas Petazzoni committed 897d07c313128 Dec 2014
Raw file
Source viewDiff to previous
xxxxxxxxxx
 
1
sqlite3: fix build when threads are not used/available
2
​
3
When threads are not used/available, a function in the sqlite3 extension
4
ends up with a label at the end:
5
​
6
    void _pysqlite_final_callback(sqlite3_context* context)
7
    {
8
        PyObject* function_result;
9
        PyObject** aggregate_instance;
10
        int ok;
11
​
12
    #ifdef WITH_THREAD
13
        PyGILState_STATE threadstate;
14
​
15
        threadstate = PyGILState_Ensure();
16
    #endif
17
​
18
        aggregate_instance = (PyObject**)sqlite3_aggregate_context(context, sizeof(PyObject*));
19
        if (!*aggregate_instance) {
20
            goto error;
21
        }
22
​
23
        [......]
24
​
25
    error:
26
    #ifdef WITH_THREAD
27
        PyGILState_Release(threadstate);
28
    #endif
29
    }
30
​
31
This is not valid, and gcc complains.
32
​
33
Fix that by adding a dummy statement after the label, so that the label
34
is never the last statement of the function.
35
​
36
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
37
​
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 */
47
 }
48
 
49
 static void _pysqlite_drop_unused_statement_references(pysqlite_Connection* self)
  • Git repository management for enterprise teams powered by Atlassian Bitbucket
  • Atlassian Bitbucket v6.7.2
  • Documentation
  • Request a feature
  • About
  • Contact Atlassian
Atlassian

Everything looks good. We'll let you know here if there's anything you should know about.