Projects
Games
garglk
garglk-fix_multiple_definitions_1.patch
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File garglk-fix_multiple_definitions_1.patch of Package garglk
From e7038f7e899a73992c3bbfbbfb91abdd32064092 Mon Sep 17 00:00:00 2001 From: Chris Spiegel <cspiegel@gmail.com> Date: Sun, 10 May 2020 21:10:09 -0700 Subject: [PATCH] Fix incorrect global declarations. The standard (and now gcc) requires that globals (with external linkage) be marked extern in headers, and defined in one (and only one) .c file. A few interpreters violated this rule, and therefore broke with the latest gcc version. Update them to conform to the standard. --- terps/alan2/glkio.h | 4 ++-- terps/alan2/main.c | 3 +++ terps/alan3/glkio.h | 4 ++-- terps/alan3/output.h | 4 ++-- terps/alan3/term.h | 2 +- terps/jacl/glk_startup.c | 2 +- terps/jacl/parser.c | 2 +- 7 files changed, 12 insertions(+), 9 deletions(-) diff --git a/terps/alan2/glkio.h b/terps/alan2/glkio.h index c12d04f4..8c3c683c 100644 --- a/terps/alan2/glkio.h +++ b/terps/alan2/glkio.h @@ -11,8 +11,8 @@ #include "glk.h" -winid_t glkMainWin; -winid_t glkStatusWin; +extern winid_t glkMainWin; +extern winid_t glkStatusWin; /* NB: this header must be included in any file which calls printf() */ diff --git a/terps/alan2/main.c b/terps/alan2/main.c index 84903953..65989124 100644 --- a/terps/alan2/main.c +++ b/terps/alan2/main.c @@ -43,6 +43,9 @@ /* PUBLIC DATA */ +winid_t glkMainWin; +winid_t glkStatusWin; + /* The Amachine memory */ Aword *memory; static AcdHdr dummyHeader; /* Dummy to use until memory allocated */ diff --git a/terps/alan3/glkio.h b/terps/alan3/glkio.h index 1a121171..70b4148c 100644 --- a/terps/alan3/glkio.h +++ b/terps/alan3/glkio.h @@ -11,8 +11,8 @@ #include "glk.h" -winid_t glkMainWin; -winid_t glkStatusWin; +static winid_t glkMainWin; +static winid_t glkStatusWin; /* NB: this header must be included in any file which calls printf() */ diff --git a/terps/alan3/output.h b/terps/alan3/output.h index c01aaaa7..25bcfde2 100644 --- a/terps/alan3/output.h +++ b/terps/alan3/output.h @@ -22,9 +22,9 @@ extern bool capitalize; /* Log file */ #ifdef HAVE_GLK #include "glk.h" -strid_t logFile; +extern strid_t logFile; #else -FILE *logFile; +extern FILE *logFile; #endif diff --git a/terps/alan3/term.h b/terps/alan3/term.h index a7f5f1b6..148ae10b 100644 --- a/terps/alan3/term.h +++ b/terps/alan3/term.h @@ -10,7 +10,7 @@ /* DATA */ -bool onStatusLine; +extern bool onStatusLine; /* FUNCTIONS */ diff --git a/terps/jacl/glk_startup.c b/terps/jacl/glk_startup.c index e704a334..a07dade9 100644 --- a/terps/jacl/glk_startup.c +++ b/terps/jacl/glk_startup.c @@ -31,7 +31,7 @@ extern short int release; glkunix_startup_t *arguments; /* THE STREAM FOR OPENING UP THE ARCHIVE CONTAINING GRAPHICS AND SOUND */ -strid_t blorb_stream; +extern strid_t blorb_stream; /* PROTOTYPE FOR NEEDED UTILITY FUNCTION */ void create_paths(); diff --git a/terps/jacl/parser.c b/terps/jacl/parser.c index fd6747a1..47ce8b31 100644 --- a/terps/jacl/parser.c +++ b/terps/jacl/parser.c @@ -62,7 +62,7 @@ char *from_word; int object_expected = FALSE; -char default_function[84]; +extern char default_function[84]; char object_name[84]; char base_function[84];
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.