Skip to content

Commit

Permalink
util: Include 'var.h' for external symbols instead of declaring locally
Browse files Browse the repository at this point in the history
Some global variables were declared locally without an extern qualifier.
This leads to link errors with newer toolchains.

Instead, drop the declarations and include "var.h" which provides all
the proper declarations.
  • Loading branch information
wens committed Apr 3, 2022
1 parent ea75e7f commit 2fae744
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
3 changes: 2 additions & 1 deletion util/reaper.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#define _UTIL_C_

#include "bbs.h"
#include "var.h"

time4_t now;

#undef MAX_GUEST_LIFE
#undef MAX_LIFE
Expand Down
3 changes: 1 addition & 2 deletions util/uhash_loader.c
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
/* standalone uhash loader -- jochang */
#include "bbs.h"
#include "fnv_hash.h"
#include "var.h"

void userec_add_to_uhash(int n, userec_t *id, int onfly);
void fill_uhash(int onfly);
void load_uhash(void);

SHM_t *SHM;

int main()
{
setgid(BBSGID);
Expand Down
4 changes: 1 addition & 3 deletions util/writemoney.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
/* 把 SHM 中的 money 全部寫回 .PASSWDS */
#define _UTIL_C_
#include "bbs.h"

time4_t now;
extern SHM_t *SHM;
#include "var.h"

int main()
{
Expand Down

0 comments on commit 2fae744

Please sign in to comment.