From 54f49829f2ce1d3463e5a7e451529de186e5e6e0 Mon Sep 17 00:00:00 2001 From: "Darryl L. Miles" Date: Wed, 2 Oct 2024 06:59:00 +0100 Subject: [PATCH] graphics: multiple definition of `various_x11_symbols' Solution is to make the grX11thread.c and grX11su1[5].c versions the official location. Another solution maybe to split them into their own file grX11common.c that would be shared. Multiple configurations tested, tested configurations assume X11 is available. The configuration wording indicates X11 must be available for all graphics enabled build configurations. Affected symbols appear to have multiple definitions: grCursors grXdpy grXscrn pipeRead pipeWrite Xhelper grVisual GCC14 and linker will not link the final executable due to this. GCC14 --without-tk --without-tcl Related issue: https://github.com/RTimothyEdwards/magic/issues/323 --- graphics/grOGL1.c | 10 +++++----- graphics/grOGL5.c | 2 +- graphics/grX11su1.c | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/graphics/grOGL1.c b/graphics/grOGL1.c index bf2bf3cb..355ba451 100644 --- a/graphics/grOGL1.c +++ b/graphics/grOGL1.c @@ -37,12 +37,12 @@ GLubyte **grOGLStipples; HashTable grOGLWindowTable; -Display *grXdpy; +extern Display *grXdpy; /* grX11thread.c */ GLXContext grXcontext; -int grXscrn; -int pipeRead, pipeWrite; -int Xhelper; -Visual *grVisual; +extern int grXscrn; /* grX11su1.c */ +extern int pipeRead, pipeWrite; /* grX11su1.c */ +extern int Xhelper; /* grX11su1.c */ +extern Visual *grVisual; /* grX11su1.c */ #ifdef HAVE_PTHREADS extern int writePipe; diff --git a/graphics/grOGL5.c b/graphics/grOGL5.c index f4ab4d0f..79c8a4d6 100644 --- a/graphics/grOGL5.c +++ b/graphics/grOGL5.c @@ -36,7 +36,7 @@ extern HashTable grOGLWindowTable; extern Display *grXdpy; extern int grXscrn; -Cursor grCursors[MAX_CURSORS]; +extern Cursor grCursors[MAX_CURSORS]; /* grX11su5.c */ /* diff --git a/graphics/grX11su1.c b/graphics/grX11su1.c index 68deaee7..f2efa4c9 100644 --- a/graphics/grX11su1.c +++ b/graphics/grX11su1.c @@ -52,7 +52,7 @@ extern char *DBWStyleType; -Display *grXdpy; +extern Display *grXdpy; /* grX11thread.c */ int grXscrn; Colormap grXcmap; Visual *grVisual;