Make gcc10 happy

gcc-10 and above flipped a default from -fcommon to -fno-common.
So now GCC will reject multiple definitions of global variables.
This commit is contained in:
Grigory Ustinov 2020-12-21 18:56:41 +03:00
parent 452bae128e
commit 8bba55df41
3 changed files with 6 additions and 2 deletions

View File

@ -8,6 +8,8 @@
#include "game.h"
#include "common.h"
struct cursor *cursor;
void cursor_malloc(struct cursor **cursor) {
if (!(*cursor = malloc(sizeof(**cursor)))) {
tty_solitaire_generic_error(errno, __FILE__, __LINE__);

View File

@ -5,6 +5,8 @@
#include "deck.h"
#include "common.h"
struct deck *deck;
void deck_malloc(struct deck **deck) {
if (!(*deck = malloc(sizeof(**deck)))) {
tty_solitaire_generic_error(errno, __FILE__, __LINE__);

View File

@ -35,8 +35,8 @@ struct game {
int four_color_deck;
};
struct deck *deck;
struct cursor *cursor;
extern struct deck *deck;
extern struct cursor *cursor;
bool maneuvre_stack(struct stack *);
bool stock_stack(struct stack *);