commit:     eb886dc4f7af47ee8c4bb6b325ef07c461c0a4b9
Author:     Mario Haustein <mario.haustein <AT> hrz <DOT> tu-chemnitz <DOT> de>
AuthorDate: Fri Jun 13 22:28:38 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Jun 14 19:01:41 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=eb886dc4

media-gfx/xfig: fix C23 compatibility

Closes: https://bugs.gentoo.org/956626
Signed-off-by: Mario Haustein <mario.haustein <AT> hrz.tu-chemnitz.de>
Part-of: https://github.com/gentoo/gentoo/pull/42587
Closes: https://github.com/gentoo/gentoo/pull/42587
Signed-off-by: Sam James <sam <AT> gentoo.org>

 media-gfx/xfig/files/xfig-3.2.9a-variables.patch | 184 +++++++++++++++++++++++
 media-gfx/xfig/xfig-3.2.9a-r1.ebuild             |   1 +
 2 files changed, 185 insertions(+)

diff --git a/media-gfx/xfig/files/xfig-3.2.9a-variables.patch 
b/media-gfx/xfig/files/xfig-3.2.9a-variables.patch
new file mode 100644
index 000000000000..94e18883d310
--- /dev/null
+++ b/media-gfx/xfig/files/xfig-3.2.9a-variables.patch
@@ -0,0 +1,184 @@
+commit d9f210b4aea9d2ddd16663a7aca55413aa1f8106
+Author: Roland Rosenfeld <[email protected]>
+Date:   Sat Mar 1 17:13:08 2025 +0100
+
+    Change variable names true/false, which conflict in GCC-15 (C23 standard) 
with predefined keywords.
+
+--- a/src/main.c
++++ b/src/main.c
+@@ -120,8 +120,8 @@ static void        check_refresh(XtPointer client_data, 
XtIntervalId *id);
+ 
+ DeclareStaticArgs(10);
+ 
+-static Boolean        true = True;
+-static Boolean        false = False;
++static Boolean        istrue = True;
++static Boolean        isfalse = False;
+ static float  Fzero = 0.0;
+ static float  Fone = 1.0;
+ static float  F100 = 100.0;
+@@ -195,11 +195,11 @@ static XtResource application_resources[] = {
+     {"zoom", "Zoom", XtRFloat, sizeof(float),
+       XtOffset(appresPtr, zoom), XtRFloat, (caddr_t) & Fone},
+     {"allownegcoords", "NegativeCoordinates",   XtRBoolean, sizeof(Boolean),
+-      XtOffset(appresPtr, allownegcoords), XtRBoolean, (caddr_t) & true},
++      XtOffset(appresPtr, allownegcoords), XtRBoolean, (caddr_t) & istrue},
+     {"showaxislines", "Axis",   XtRBoolean, sizeof(Boolean),
+-      XtOffset(appresPtr, showaxislines), XtRBoolean, (caddr_t) & true},
++      XtOffset(appresPtr, showaxislines), XtRBoolean, (caddr_t) & istrue},
+     {"smallicons", "Icons",   XtRBoolean, sizeof(Boolean),
+-      XtOffset(appresPtr, smallicons), XtRBoolean, (caddr_t) & false},
++      XtOffset(appresPtr, smallicons), XtRBoolean, (caddr_t) & isfalse},
+     {"canvasbackground",  "Background",    XtRString,  sizeof(char *),
+       XtOffset(appresPtr,canvasbackground), XtRString, (caddr_t) NULL},
+     {"canvasforeground",  "Foreground",    XtRString,  sizeof(char *),
+@@ -207,19 +207,19 @@ static XtResource application_resources[] = {
+     {"iconGeometry",  "IconGeometry",    XtRString,  sizeof(char *),
+       XtOffset(appresPtr,iconGeometry), XtRString, (caddr_t) NULL},
+     {"showallbuttons", "ShowAllButtons",   XtRBoolean, sizeof(Boolean),
+-      XtOffset(appresPtr, showallbuttons), XtRBoolean, (caddr_t) & false},
++      XtOffset(appresPtr, showallbuttons), XtRBoolean, (caddr_t) & isfalse},
+     {XtNjustify,   XtCJustify, XtRBoolean, sizeof(Boolean),
+-      XtOffset(appresPtr, RHS_PANEL), XtRBoolean, (caddr_t) & false},
++      XtOffset(appresPtr, RHS_PANEL), XtRBoolean, (caddr_t) & isfalse},
+     {"landscape",   XtCOrientation, XtRBoolean, sizeof(Boolean),
+-      XtOffset(appresPtr, landscape), XtRBoolean, (caddr_t) & true},
++      XtOffset(appresPtr, landscape), XtRBoolean, (caddr_t) & istrue},
+     {"pwidth",   XtCWidth, XtRFloat, sizeof(float),
+       XtOffset(appresPtr, tmp_width), XtRFloat, (caddr_t) & Fzero},
+     {"pheight",   XtCHeight, XtRFloat, sizeof(float),
+       XtOffset(appresPtr, tmp_height), XtRFloat, (caddr_t) & Fzero},
+     {"trackCursor", "Track",   XtRBoolean, sizeof(Boolean),
+-      XtOffset(appresPtr, tracking), XtRBoolean, (caddr_t) & true},
++      XtOffset(appresPtr, tracking), XtRBoolean, (caddr_t) & istrue},
+     {"inches", "Inches",   XtRBoolean, sizeof(Boolean),
+-      XtOffset(appresPtr, INCHES), XtRBoolean, (caddr_t) & true},
++      XtOffset(appresPtr, INCHES), XtRBoolean, (caddr_t) & istrue},
+     {"normalFont", "Font",   XtRString, sizeof(char *),
+       XtOffset(appresPtr, normalFont), XtRString, (caddr_t) NULL},
+     {"buttonFont", "Font",   XtRString, sizeof(char *),
+@@ -257,23 +257,23 @@ static XtResource application_resources[] = {
+     {"startposnmode", "StartPosnMode",   XtRInt, sizeof(int),
+       XtOffset(appresPtr, startposnmode), XtRImmediate, (caddr_t) 1 },
+     {"latexfonts", "Latexfonts",   XtRBoolean, sizeof(Boolean),
+-      XtOffset(appresPtr, latexfonts), XtRBoolean, (caddr_t) & false},
++      XtOffset(appresPtr, latexfonts), XtRBoolean, (caddr_t) & isfalse},
+     {"hiddentext", "HiddenText",   XtRBoolean, sizeof(Boolean),
+-      XtOffset(appresPtr, hiddentext), XtRBoolean, (caddr_t) & false},
++      XtOffset(appresPtr, hiddentext), XtRBoolean, (caddr_t) & isfalse},
+     {"rigidtext", "RigidText",   XtRBoolean, sizeof(Boolean),
+-      XtOffset(appresPtr, rigidtext), XtRBoolean, (caddr_t) & false},
++      XtOffset(appresPtr, rigidtext), XtRBoolean, (caddr_t) & isfalse},
+     {"specialtext", "SpecialText",   XtRBoolean, sizeof(Boolean),
+-      XtOffset(appresPtr, specialtext), XtRBoolean, (caddr_t) & false},
++      XtOffset(appresPtr, specialtext), XtRBoolean, (caddr_t) & isfalse},
+     {"monochrome", "Monochrome",   XtRBoolean, sizeof(Boolean),
+-      XtOffset(appresPtr, monochrome), XtRBoolean, (caddr_t) & false},
++      XtOffset(appresPtr, monochrome), XtRBoolean, (caddr_t) & isfalse},
+     {"latexfonts", "Latexfonts",   XtRBoolean, sizeof(Boolean),
+-      XtOffset(appresPtr, latexfonts), XtRBoolean, (caddr_t) & false},
++      XtOffset(appresPtr, latexfonts), XtRBoolean, (caddr_t) & isfalse},
+     {"keyFile", "KeyFile",   XtRString, sizeof(char *),
+       XtOffset(appresPtr, keyFile), XtRString, (caddr_t) "CompKeyDB"},
+     {"exportLanguage", "ExportLanguage",   XtRString, sizeof(char *),
+       XtOffset(appresPtr, exportLanguage), XtRString, (caddr_t) "eps"},
+     {"flushleft", "FlushLeft",   XtRBoolean, sizeof(Boolean),
+-      XtOffset(appresPtr, flushleft), XtRBoolean, (caddr_t) & false},
++      XtOffset(appresPtr, flushleft), XtRBoolean, (caddr_t) & isfalse},
+     {"userscale", "UserScale",   XtRFloat, sizeof(float),
+       XtOffset(appresPtr, userscale), XtRFloat, (caddr_t) & Fone},
+     {"userunit", "UserUnit",   XtRString, sizeof(char *),
+@@ -283,11 +283,11 @@ static XtResource application_resources[] = {
+     {"max_image_colors", "Max_image_colors", XtRInt, sizeof(int),
+       XtOffset(appresPtr, max_image_colors), XtRImmediate, (caddr_t) 0},
+     {"installowncmap", "Installcmap", XtRBoolean, sizeof(Boolean),
+-      XtOffset(appresPtr, installowncmap), XtRBoolean, (caddr_t) & false},
++      XtOffset(appresPtr, installowncmap), XtRBoolean, (caddr_t) & isfalse},
+     {"dontswitchcmap", "Dontswitchcmap", XtRBoolean, sizeof(Boolean),
+-      XtOffset(appresPtr, dontswitchcmap), XtRBoolean, (caddr_t) & false},
++      XtOffset(appresPtr, dontswitchcmap), XtRBoolean, (caddr_t) & isfalse},
+     {"tablet", "Tablet", XtRBoolean, sizeof(Boolean),
+-      XtOffset(appresPtr, tablet), XtRBoolean, (caddr_t) & false},
++      XtOffset(appresPtr, tablet), XtRBoolean, (caddr_t) & isfalse},
+     {"rulerthick", "RulerThick", XtRInt, sizeof(int),
+       XtOffset(appresPtr, rulerthick), XtRImmediate, (caddr_t) 0},
+     {"image_editor", "ImageEditor", XtRString, sizeof(char *),
+@@ -297,11 +297,11 @@ static XtResource application_resources[] = {
+     {"paper_size", "Papersize", XtRString, sizeof(char *),
+       XtOffset(appresPtr, paper_size), XtRString, (caddr_t) NULL},
+     {"multiple",   XtCOrientation, XtRBoolean, sizeof(Boolean),
+-      XtOffset(appresPtr, multiple), XtRBoolean, (caddr_t) & false},
++      XtOffset(appresPtr, multiple), XtRBoolean, (caddr_t) & isfalse},
+     {"overlap",   XtCOrientation, XtRBoolean, sizeof(Boolean),
+-      XtOffset(appresPtr, overlap), XtRBoolean, (caddr_t) & false},
++      XtOffset(appresPtr, overlap), XtRBoolean, (caddr_t) & isfalse},
+     {"showballoons",   "ShowBalloons", XtRBoolean, sizeof(Boolean),
+-      XtOffset(appresPtr, showballoons), XtRBoolean, (caddr_t) & true},
++      XtOffset(appresPtr, showballoons), XtRBoolean, (caddr_t) & istrue},
+     {"balloon_delay", "balloonDelay", XtRInt, sizeof(int),
+       XtOffset(appresPtr, balloon_delay), XtRImmediate, (caddr_t) 500},
+     {"spellcheckcommand", "spellCheckCommand",   XtRString, sizeof(char *),
+@@ -313,13 +313,13 @@ static XtResource application_resources[] = {
+     {"library_dir", "Directory", XtRString, sizeof(char *),
+       XtOffset(appresPtr, library_dir), XtRString, (caddr_t) OBJLIBDIR},
+     {"debug", "Debug",   XtRBoolean, sizeof(Boolean),
+-      XtOffset(appresPtr, DEBUG), XtRBoolean, (caddr_t) & false},
++      XtOffset(appresPtr, DEBUG), XtRBoolean, (caddr_t) & isfalse},
+     {"showlengths", "Debug",   XtRBoolean, sizeof(Boolean),
+-      XtOffset(appresPtr, showlengths), XtRBoolean, (caddr_t) & false},
++      XtOffset(appresPtr, showlengths), XtRBoolean, (caddr_t) & isfalse},
+     {"shownums", "Debug",   XtRBoolean, sizeof(Boolean),
+-      XtOffset(appresPtr, shownums), XtRBoolean, (caddr_t) & false},
++      XtOffset(appresPtr, shownums), XtRBoolean, (caddr_t) & isfalse},
+     {"showpageborder", "Debug",   XtRBoolean, sizeof(Boolean),
+-      XtOffset(appresPtr, show_pageborder), XtRBoolean, (caddr_t) & true},
++      XtOffset(appresPtr, show_pageborder), XtRBoolean, (caddr_t) & istrue},
+     {"pageborder", "Color",   XtRString, sizeof(char *),
+       XtOffset(appresPtr, pageborder), XtRString, (caddr_t) "lightblue"},
+     {"browser", "Browser", XtRString, sizeof(char *),
+@@ -333,17 +333,17 @@ static XtResource application_resources[] = {
+     {"export_margin", "Margin",   XtRInt, sizeof(int),
+       XtOffset(appresPtr, export_margin), XtRImmediate, (caddr_t) 
DEF_EXPORT_MARGIN},
+     {"showdepthmanager", "Hints",   XtRBoolean, sizeof(Boolean),
+-      XtOffset(appresPtr, showdepthmanager), XtRBoolean, (caddr_t) & true},
++      XtOffset(appresPtr, showdepthmanager), XtRBoolean, (caddr_t) & istrue},
+     {"flipvisualhints", "Hints",   XtRBoolean, sizeof(Boolean),
+-      XtOffset(appresPtr, flipvisualhints), XtRBoolean, (caddr_t) & false},
++      XtOffset(appresPtr, flipvisualhints), XtRBoolean, (caddr_t) & isfalse},
+     {"smooth_factor", "Smooth",   XtRInt, sizeof(int),
+       XtOffset(appresPtr, smooth_factor), XtRImmediate, (caddr_t) 0},
+     {"icon_view", "View",   XtRBoolean, sizeof(Boolean),
+-      XtOffset(appresPtr, icon_view), XtRBoolean, (caddr_t) & true},
++      XtOffset(appresPtr, icon_view), XtRBoolean, (caddr_t) & istrue},
+     {"library_icon_size", "Dimension",   XtRInt, sizeof(int),
+       XtOffset(appresPtr, library_icon_size), XtRImmediate, (caddr_t) 
DEF_ICON_SIZE},
+     {"splash", "View",   XtRBoolean, sizeof(Boolean),
+-      XtOffset(appresPtr, splash), XtRBoolean, (caddr_t) & true},
++      XtOffset(appresPtr, splash), XtRBoolean, (caddr_t) & istrue},
+     {"axislines", "Color",   XtRString, sizeof(char *),
+       XtOffset(appresPtr, axislines), XtRString, (caddr_t) "pink"},
+     {"freehand_resolution", "Hints",   XtRInt, sizeof(int),
+@@ -351,17 +351,17 @@ static XtResource application_resources[] = {
+     {"ghostscript", "Ghostscript",   XtRString, sizeof(char *),
+       XtOffset(appresPtr, ghostscript), XtRString, (caddr_t) GSEXE},
+     {"correct_font_size", "Size",   XtRBoolean, sizeof(Boolean),
+-      XtOffset(appresPtr, correct_font_size), XtRBoolean, (caddr_t) & true},
++      XtOffset(appresPtr, correct_font_size), XtRBoolean, (caddr_t) & istrue},
+     {"write_v40", "Format",   XtRBoolean, sizeof(Boolean),
+-      XtOffset(appresPtr, write_v40), XtRBoolean, (caddr_t) & false},
++      XtOffset(appresPtr, write_v40), XtRBoolean, (caddr_t) & isfalse},
+     {"crosshair", "Crosshair",   XtRBoolean, sizeof(Boolean),
+-      XtOffset(appresPtr, crosshair), XtRBoolean, (caddr_t) & false},
++      XtOffset(appresPtr, crosshair), XtRBoolean, (caddr_t) & isfalse},
+     {"autorefresh", "Refresh",   XtRBoolean, sizeof(Boolean),
+-      XtOffset(appresPtr, autorefresh), XtRBoolean, (caddr_t) & false},
++      XtOffset(appresPtr, autorefresh), XtRBoolean, (caddr_t) & isfalse},
+     {"write_bak", "Refresh",   XtRBoolean, sizeof(Boolean),
+-      XtOffset(appresPtr, write_bak), XtRBoolean, (caddr_t) & true},
++      XtOffset(appresPtr, write_bak), XtRBoolean, (caddr_t) & istrue},
+     {"international", "International", XtRBoolean, sizeof(Boolean),
+-       XtOffset(appresPtr, international), XtRBoolean, (caddr_t) & true},
++       XtOffset(appresPtr, international), XtRBoolean, (caddr_t) & istrue},
+     {"fontMenulanguage", "Language", XtRString, sizeof(char *),
+        XtOffset(appresPtr, font_menu_language), XtRString, (caddr_t) ""},
+     {"fixedFontSet", "FontSet", XtRFontSet, sizeof(XFontSet),

diff --git a/media-gfx/xfig/xfig-3.2.9a-r1.ebuild 
b/media-gfx/xfig/xfig-3.2.9a-r1.ebuild
index b31c834f71fb..87ab8441aab1 100644
--- a/media-gfx/xfig/xfig-3.2.9a-r1.ebuild
+++ b/media-gfx/xfig/xfig-3.2.9a-r1.ebuild
@@ -40,6 +40,7 @@ PATCHES=(
        "${FILESDIR}/${PN}-3.2.6a-solaris.patch"
        "${FILESDIR}/${PN}-3.2.9-app-defaults.patch"
        "${DISTDIR}/${P}-modern-c.patch"
+       "${FILESDIR}/${PN}-3.2.9a-variables.patch"
 )
 
 src_configure() {

Reply via email to