From 2fed1d019cdf1f385ec69a4003db488396905132 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Mon, 4 Mar 2024 10:47:13 +0100 Subject: [PATCH] dix: colormap: fix name clash with win32 api on UpdateColors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As soon as winapi headers are included, we're running into a name clash on UpdateColors(), since winapi has a function by the same name. Trivial fix simply renaming our own UpdateColors() function. ../dix/colormap.c:110:13: error: conflicting types for ‘UpdateColors’ 110 | static void UpdateColors(ColormapPtr /*pmap */ | ^~~~~~~~~~~~ In file included from /usr/share/mingw-w64/include/windows.h:71, from /usr/share/mingw-w64/include/winsock2.h:23, from /usr/i686-w64-mingw32/include/X11/Xwinsock.h:57, from ../os/osdep.h:138, from ../dix/colormap.c:57: /usr/share/mingw-w64/include/wingdi.h:3202:28: note: previous declaration of ‘UpdateColors’ was here 3202 | WINGDIAPI WINBOOL WINAPI UpdateColors(HDC hdc); | ^~~~~~~~~~~~ Signed-off-by: Enrico Weigelt, metux IT consult Part-of: (cherry picked from commit d8cbcfd601206a8c0fefc5d1e73246aebc9f7c30) --- dix/colormap.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/dix/colormap.c b/dix/colormap.c index 146f42295..3f366b77f 100644 --- a/dix/colormap.c +++ b/dix/colormap.c @@ -104,8 +104,7 @@ static void FreeCell(ColormapPtr /*pmap */ , int /*channel */ ); -static void UpdateColors(ColormapPtr /*pmap */ - ); +static void doUpdateColors(ColormapPtr pmap); static int AllocDirect(int /*client */ , ColormapPtr /*pmap */ , @@ -555,7 +554,7 @@ CopyColormapAndFree(Colormap mid, ColormapPtr pSrc, int client) } pSrc->flags &= ~AllAllocated; FreePixels(pSrc, client); - UpdateColors(pmap); + doUpdateColors(pmap); return Success; } @@ -565,7 +564,7 @@ CopyColormapAndFree(Colormap mid, ColormapPtr pSrc, int client) CopyFree(BLUEMAP, client, pSrc, pmap); } if (pmap->class & DynamicClass) - UpdateColors(pmap); + doUpdateColors(pmap); /* XXX should worry about removing any X11_RESTYPE_CMAPENTRY resource */ return Success; } @@ -695,7 +694,7 @@ FreeCell(ColormapPtr pmap, Pixel i, int channel) } static void -UpdateColors(ColormapPtr pmap) +doUpdateColors(ColormapPtr pmap) { xColorItem *defs; xColorItem *pdef;