1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-26 05:02:18 +00:00

Ensure that there is only one variable definition per each object, as

the C (and C++) standards mandated for years and compilers started to
enforce as of recently (Clang 11, GCC 10).

Reported by:	pkg-fallout
This commit is contained in:
Alexey Dokuchaev 2020-10-15 11:22:57 +00:00
parent fd023642f5
commit 6b620ace29
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=552406
5 changed files with 102 additions and 2 deletions

View File

@ -59,8 +59,21 @@ post-patch:
# Do not #include <sys/dir.h> header which is deprecated
@${REINPLACE_CMD} -e '/#include/s,<sys/dir,&ent,' \
${WRKSRC}/tools/quake2/qdata/qdata.c
@${REINPLACE_CMD} -e 's,#ifndef WIN32,#ifdef NeXT,' \
${WRKSRC}/tools/quake3/q3data/q3data.c
# Cope with -fno-common being the default in some new compilers
@${REINPLACE_CMD} -e '/\*CalcTextureReflectivity/s,^void,extern &,' \
${WRKSRC}/tools/quake2/q2map/qrad.h
@${REINPLACE_CMD} -E 's,^char[[:blank:]]+outbase,extern &,' \
${WRKSRC}/tools/quake2/q2map/qvis.c
@${REINPLACE_CMD} -e '/materialtypes/s,^materialtype_t,extern &,' \
${WRKSRC}/tools/quake2/qdata_heretic2/common/qfiles.h
@${REINPLACE_CMD} -e '/\*byteimage, \*lbmpalette/,+5d' \
${WRKSRC}/tools/quake2/qdata_heretic2/book.c
@${REINPLACE_CMD} -e '/g_frames/s,^frame_t,extern &,' \
${WRKSRC}/tools/quake2/qdata_heretic2/models.c
@${REINPLACE_CMD} -e '/verbose;/d' \
${WRKSRC}/tools/quake3/q3map2/q3map2.h
@${REINPLACE_CMD} -e '/c_portalskip, c_leafskip/,+1d' \
${WRKSRC}/tools/quake3/q3map2/visflow.c
pre-install:
cd ${WRKSRC} && ${PYTHON_CMD} install.py

View File

@ -0,0 +1,27 @@
--- tools/quake2/q2map/qrad.c.orig 2006-02-10 22:01:20 UTC
+++ tools/quake2/q2map/qrad.c
@@ -44,7 +44,7 @@
vec3_t face_offset[MAX_MAP_FACES]; // for rotating bmodels
dplane_t backplanes[MAX_MAP_PLANES];
-char inbase[32], outbase[32];
+extern char inbase[32], outbase[32];
int fakeplanes; // created planes for origin offset
@@ -64,11 +64,13 @@
float lightscale = 1.0;
-qboolean glview;
+extern qboolean glview;
qboolean nopvs;
-char source[1024];
+extern char source[1024];
+
+void (*CalcTextureReflectivity) (void);
float direct_scale = 0.4;
float entity_scale = 1.0;

View File

@ -0,0 +1,27 @@
--- tools/quake2/qdata_heretic2/sprites.c.orig 2006-02-10 22:01:20 UTC
+++ tools/quake2/qdata_heretic2/sprites.c
@@ -25,15 +25,8 @@
#define MAX_SPRFRAMES MAX_MD2SKINS
dsprite_t sprite;
-dsprframe_t frames[MAX_SPRFRAMES];
+extern dsprframe_t frames[MAX_SPRFRAMES];
-byte *byteimage, *lbmpalette;
-int byteimagewidth, byteimageheight;
-
-qboolean TrueColorImage;
-unsigned *longimage;
-int longimagewidth, longimageheight;
-
char spritename[1024];
@@ -41,7 +34,6 @@
void Cmd_Spritename (void);
char spr_prefix[1024];
-char pic_prefix[1024];
extern char *g_outputDir;

View File

@ -0,0 +1,20 @@
--- tools/quake3/q3data/q3data.c.orig 2006-02-10 22:01:20 UTC
+++ tools/quake3/q3data/q3data.c
@@ -37,8 +37,6 @@
// bogus externs for some TA hacks (common/ using them against q3map)
char *moddir = NULL;
-// some old defined that was in cmdlib lost during merge
-char writedir[1024];
#if defined (__linux__) || defined (__APPLE__)
#define strlwr strlower
@@ -341,7 +339,7 @@
#else
#include <sys/types.h>
-#ifndef WIN32
+#ifdef NeXT
#include <sys/dir.h>
#else
#include <sys/dirent.h>

View File

@ -0,0 +1,13 @@
--- tools/quake3/q3map2/q3map2.h.orig 2006-02-10 22:01:20 UTC
+++ tools/quake3/q3map2/q3map2.h
@@ -939,6 +939,10 @@
}
surfaceType_t;
+// Q_EXTERN is defined only later :(
+#ifndef MAIN_C
+extern
+#endif
char *surfaceTypes[ NUM_SURFACE_TYPES ]
#ifndef MAIN_C
;