Skip to content

Commit 6636634

Browse files
committed
Fix build error caused by inline function under Debug mode with CMake
1 parent 55dc004 commit 6636634

3 files changed

Lines changed: 15 additions & 0 deletions

File tree

src/hash_dict.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ static const unsigned int hash_dict_prime_list[] = {
3636

3737
static const unsigned int hash_dict_prime_list_count = sizeof(hash_dict_prime_list) / sizeof(hash_dict_prime_list[0]);
3838

39+
// External definition for inline function
40+
extern inline unsigned int hash_dict_item_count(HASH_DICT *p_dict);
41+
3942
HASH_DICT *hash_dict_create(int item_count_limit)
4043
{
4144
HASH_DICT *p_dict = NULL;

src/menu.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ static const char MENU_CONF_DELIM_WITHOUT_SPACE[] = "\r\n";
4040
MENU_SET bbs_menu;
4141
MENU_SET top10_menu;
4242

43+
// External definitions for inline functions
44+
extern inline MENU *get_menu(MENU_SET *p_menu_set, const char *menu_name);
45+
extern inline MENU *get_menu_by_id(MENU_SET *p_menu_set, MENU_ID menu_id);
46+
extern inline MENU_ITEM *get_menu_item_by_id(MENU_SET *p_menu_set, MENU_ITEM_ID menu_item_id);
47+
extern inline MENU_SCREEN *get_menu_screen_by_id(MENU_SET *p_menu_set, MENU_SCREEN_ID menu_screen_id);
48+
4349
int load_menu(MENU_SET *p_menu_set, const char *conf_file)
4450
{
4551
char filepath[FILE_PATH_LEN];

src/user_priv.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@
2121

2222
BBS_user_priv BBS_priv;
2323

24+
// External definitions for inline functions
25+
extern inline int checklevel(BBS_user_priv *p_priv, int level);
26+
extern inline int checklevel2(BBS_user_priv *p_priv, int level);
27+
extern inline int checkpriv(BBS_user_priv *p_priv, int sid, int priv);
28+
extern inline int is_favor(BBS_user_priv *p_priv, int sid);
29+
2430
inline static int search_priv(BBS_user_priv *p_priv, int sid, int *p_offset)
2531
{
2632
int left = 0;

0 commit comments

Comments
 (0)