我对此感到困惑.... SQLite 是一个单独的项目,也是工作区的一部分。在构建目标时,LLVM 抱怨:
<path>/sqlite3.c:44924:24: Incomplete definition of type 'struct Btree'
那是在第 44924 行(以及 44924 之后的 14 个其他地方)。这是我看到的其他内容:
7145: /* Forward declaration */
7146: typedef struct Btree Btree;
...
11378: struct Btree {
11379: sqlite3 *db; /* The database connection holding this btree */
11380: BtShared *pBt; /* Sharable content of this btree */
11381: u8 inTrans; /* TRANS_NONE, TRANS_READ or TRANS_WRITE */
11382: u8 sharable; /* True if we can share pBt with another db */
11383: u8 locked; /* True if db currently has pBt locked */
11384: int wantToLock; /* Number of nested calls to sqlite3BtreeEnter() */
11385: int nBackup; /* Number of backup operations reading this btree */
11386: Btree *pNext; /* List of other sharable Btrees from the same db */
11387: Btree *pPrev; /* Back pointer of the same list */
11388:#ifndef SQLITE_OMIT_SHARED_CACHE
11389: BtLock lock; /* Object used to lock page 1 */
11390:#endif
11391:};
...
44919: static void lockBtreeMutex(Btree *p){
44920: assert( p->locked==0 );
44921: assert( sqlite3_mutex_notheld(p->pBt->mutex) );
44922: assert( sqlite3_mutex_held(p->db->mutex) );
44923:
44924: sqlite3_mutex_enter(p->pBt->mutex);
44925: p->pBt->db = p->db;
44926: p->locked = 1;
44927: }
我还尝试将 11378 处的结构重命名为struct Btree_S
(并更改了typedef
)。同样的问题。
我想我的问题是,它怎么可能不完整?有任何想法吗?