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; int maxwidth;
} match; } match;
Font* font; extern Font* font;
CTuple cnorm; extern CTuple cnorm;
CTuple csel; extern CTuple csel;
EXTERN Item hist; EXTERN Item hist;
EXTERN Item* histsel; EXTERN Item* histsel;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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