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:
parent
452bae128e
commit
8bba55df41
@ -8,6 +8,8 @@
|
|||||||
#include "game.h"
|
#include "game.h"
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
|
struct cursor *cursor;
|
||||||
|
|
||||||
void cursor_malloc(struct cursor **cursor) {
|
void cursor_malloc(struct cursor **cursor) {
|
||||||
if (!(*cursor = malloc(sizeof(**cursor)))) {
|
if (!(*cursor = malloc(sizeof(**cursor)))) {
|
||||||
tty_solitaire_generic_error(errno, __FILE__, __LINE__);
|
tty_solitaire_generic_error(errno, __FILE__, __LINE__);
|
||||||
|
@ -5,6 +5,8 @@
|
|||||||
#include "deck.h"
|
#include "deck.h"
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
|
struct deck *deck;
|
||||||
|
|
||||||
void deck_malloc(struct deck **deck) {
|
void deck_malloc(struct deck **deck) {
|
||||||
if (!(*deck = malloc(sizeof(**deck)))) {
|
if (!(*deck = malloc(sizeof(**deck)))) {
|
||||||
tty_solitaire_generic_error(errno, __FILE__, __LINE__);
|
tty_solitaire_generic_error(errno, __FILE__, __LINE__);
|
||||||
|
@ -35,8 +35,8 @@ struct game {
|
|||||||
int four_color_deck;
|
int four_color_deck;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct deck *deck;
|
extern struct deck *deck;
|
||||||
struct cursor *cursor;
|
extern struct cursor *cursor;
|
||||||
|
|
||||||
bool maneuvre_stack(struct stack *);
|
bool maneuvre_stack(struct stack *);
|
||||||
bool stock_stack(struct stack *);
|
bool stock_stack(struct stack *);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user