fix build with GCC 10 and upper

GCC switched default from -fcommon to -fno-common,
leading to the following compilation errors:

multiple definition of `argv0'
multiple definition of `display'
multiple definition of `scr'
multiple definition of `font'
multiple definition of `cnorm'
multiple definition of `csel'
multiple definition of `debugflag'
multiple definition of `debugfile'
multiple definition of `cursor'
multiple definition of `framehandler'
multiple definition of `NM'
This commit is contained in:
David du Colombier 2021-10-15 22:12:16 +02:00
parent 2d098b667d
commit 3acb239918
13 changed files with 44 additions and 12 deletions

View File

@ -93,9 +93,9 @@ EXTERN struct {
int maxwidth;
} match;
Font* font;
CTuple cnorm;
CTuple csel;
extern Font* font;
extern CTuple cnorm;
extern CTuple csel;
EXTERN Item hist;
EXTERN Item* histsel;

View File

@ -12,6 +12,13 @@
#include "fns.h"
#define link _link
char *argv0;
Display *display;
Screen scr;
Font* font;
CTuple cnorm;
CTuple csel;
static const char version[] = "wimenu-"VERSION", "COPYRIGHT"\n";
static Biobuf* cmplbuf;
static Biobuf* inbuf;

View File

@ -12,6 +12,6 @@
enum { DAuto, DHorizontal, DVertical };
EXTERN Handlers handlers;
extern Handlers handlers;
EXTERN int direction;

View File

@ -9,6 +9,10 @@
#include <time.h>
#include "fns.h"
char *argv0;
Display *display;
Screen scr;
static Window* testwin;
static ulong testtime[2];

View File

@ -11,6 +11,10 @@
#include <sys/signal.h>
#include "fns.h"
char *argv0;
Display *display;
Screen scr;
static const char version[] = "witray-"VERSION", "COPYRIGHT"\n";
static int exitsignal;

View File

@ -42,7 +42,7 @@ enum {
CurNone,
CurLast,
};
Cursor cursor[CurLast];
extern Cursor cursor[CurLast];
enum IncMode {
IIgnore,
@ -355,11 +355,11 @@ EXTERN Key* key;
EXTERN View* selview;
EXTERN View* view;
EXTERN Handlers framehandler;
extern Handlers framehandler;
/* IXP */
EXTERN IxpServer srv;
EXTERN Ixp9Srv p9srv;
extern Ixp9Srv p9srv;
/* X11 */
EXTERN uint numlock_mask;

View File

@ -20,5 +20,5 @@ void dwrite(int, void*, int, bool);
bool setdebug(int);
void vdebug(int, const char*, va_list);
long debugflag;
long debugfile;
extern long debugflag;
extern long debugfile;

View File

@ -14,6 +14,13 @@
#include <sys/stat.h>
#include "fns.h"
char *argv0;
Display *display;
Screen scr;
Cursor cursor[CurLast];
long debugflag;
long debugfile;
static const char
version[] = "wmii-"VERSION", "COPYRIGHT"\n";

View File

@ -20,6 +20,8 @@
#include <bio.h>
#include <fmt.h>
char *argv0;
static IxpClient* client;
static Biobuf* outbuf;
static bool binary;

View File

@ -7,6 +7,10 @@
#include <locale.h>
#include <unistd.h>
char *argv0;
Display *display;
Screen scr;
static const char version[] = "wikeyname-"VERSION", "COPYRIGHT"\n";
static Handlers handlers;

View File

@ -48,6 +48,10 @@
#include <stuff/util.h>
#include <stuff/x.h>
char *argv0;
Display *display;
Screen scr;
char version[] = "wmii9menu-"VERSION" "COPYRIGHT", ©1994 David Hogan, Arnold Robbins";
static Window* menuwin;

View File

@ -214,8 +214,8 @@ struct Screen {
# pragma varargck type "W" Window*
#endif
Display *display;
Screen scr;
extern Display *display;
extern Screen scr;
extern char* modkey_names[];
extern struct Map windowmap;

View File

@ -13,7 +13,7 @@ struct MapEnt {
MapEnt* next;
};
MapEnt *NM;
static MapEnt *NM;
/* By Dan Bernstein. Public domain. */
static ulong