diff options
author | Enrico Weigelt, metux IT consult <info@metux.net> | 2024-03-04 15:08:32 +0100 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2024-04-15 18:59:23 -0700 |
commit | 232cad9ec36631379b23ce29d577332f82565803 (patch) | |
tree | 610b389034511f242886ffab99b22593a6fd1592 /composite | |
parent | f789dca4e9e0ca5cfcdb1f95a7479cb1ca113738 (diff) |
prevent name clash on Windows w/ RT_* defines
Windows' native headers using some our RT_* define's names for other things.
Since the naming isn't very nice anyways, introducing some new ones
(X11_RESTYPE_NONE, X11_RESTYPE_FONT, X11_RESTYPE_CURSOR) and define the old
ones as an alias to them, in case some out-of-tree code still uses them.
With thins change, we don't need to be so extremely careful about include
ordering and have explicit #undef's in order to prevent name clashes on
Win32 targets.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1355>
Diffstat (limited to 'composite')
-rw-r--r-- | composite/compalloc.c | 6 | ||||
-rw-r--r-- | composite/compext.c | 18 | ||||
-rw-r--r-- | composite/compoverlay.c | 2 | ||||
-rw-r--r-- | composite/compwindow.c | 4 |
4 files changed, 15 insertions, 15 deletions
diff --git a/composite/compalloc.c b/composite/compalloc.c index acd215002..f97b6c688 100644 --- a/composite/compalloc.c +++ b/composite/compalloc.c @@ -217,7 +217,7 @@ compRedirectWindow(ClientPtr pClient, WindowPtr pWin, int update) } if (!compCheckRedirect(pWin)) { - FreeResource(ccw->id, RT_NONE); + FreeResource(ccw->id, X11_RESTYPE_NONE); return BadAlloc; } @@ -329,7 +329,7 @@ compUnredirectWindow(ClientPtr pClient, WindowPtr pWin, int update) for (ccw = cw->clients; ccw; ccw = ccw->next) if (ccw->update == update && CLIENT_ID(ccw->id) == pClient->index) { - FreeResource(ccw->id, RT_NONE); + FreeResource(ccw->id, X11_RESTYPE_NONE); return Success; } return BadValue; @@ -477,7 +477,7 @@ compUnredirectSubwindows(ClientPtr pClient, WindowPtr pWin, int update) return BadValue; for (ccw = csw->clients; ccw; ccw = ccw->next) if (ccw->update == update && CLIENT_ID(ccw->id) == pClient->index) { - FreeResource(ccw->id, RT_NONE); + FreeResource(ccw->id, X11_RESTYPE_NONE); return Success; } return BadValue; diff --git a/composite/compext.c b/composite/compext.c index 31ebbbf67..1f8194f80 100644 --- a/composite/compext.c +++ b/composite/compext.c @@ -265,7 +265,7 @@ ProcCompositeNameWindowPixmap(ClientPtr client) if (pScreen->NameWindowPixmap) { rc = pScreen->NameWindowPixmap(pWin, pPixmap, stuff->pixmap); if (rc != Success) { - FreeResource(stuff->pixmap, RT_NONE); + FreeResource(stuff->pixmap, X11_RESTYPE_NONE); return rc; } } @@ -302,14 +302,14 @@ ProcCompositeGetOverlayWindow(ClientPtr client) cs = GetCompScreen(pScreen); if (cs->pOverlayWin == NULL) if (!compCreateOverlayWindow(pScreen)) { - FreeResource(pOc->resource, RT_NONE); + FreeResource(pOc->resource, X11_RESTYPE_NONE); return BadAlloc; } rc = XaceHook(XACE_RESOURCE_ACCESS, client, cs->pOverlayWin->drawable.id, - RT_WINDOW, cs->pOverlayWin, RT_NONE, NULL, DixGetAttrAccess); + RT_WINDOW, cs->pOverlayWin, X11_RESTYPE_NONE, NULL, DixGetAttrAccess); if (rc != Success) { - FreeResource(pOc->resource, RT_NONE); + FreeResource(pOc->resource, X11_RESTYPE_NONE); return rc; } @@ -349,7 +349,7 @@ ProcCompositeReleaseOverlayWindow(ClientPtr client) return BadMatch; /* The delete function will free the client structure */ - FreeResource(pOc->resource, RT_NONE); + FreeResource(pOc->resource, X11_RESTYPE_NONE); return Success; } @@ -820,17 +820,17 @@ PanoramiXCompositeGetOverlayWindow(ClientPtr client) cs = GetCompScreen(pScreen); if (cs->pOverlayWin == NULL) if (!compCreateOverlayWindow(pScreen)) { - FreeResource(pOc->resource, RT_NONE); + FreeResource(pOc->resource, X11_RESTYPE_NONE); free(overlayWin); return BadAlloc; } rc = XaceHook(XACE_RESOURCE_ACCESS, client, cs->pOverlayWin->drawable.id, - RT_WINDOW, cs->pOverlayWin, RT_NONE, NULL, + RT_WINDOW, cs->pOverlayWin, X11_RESTYPE_NONE, NULL, DixGetAttrAccess); if (rc != Success) { - FreeResource(pOc->resource, RT_NONE); + FreeResource(pOc->resource, X11_RESTYPE_NONE); free(overlayWin); return rc; } @@ -898,7 +898,7 @@ PanoramiXCompositeReleaseOverlayWindow(ClientPtr client) return BadMatch; /* The delete function will free the client structure */ - FreeResource(pOc->resource, RT_NONE); + FreeResource(pOc->resource, X11_RESTYPE_NONE); } return Success; diff --git a/composite/compoverlay.c b/composite/compoverlay.c index eb2d86e0d..1e077b892 100644 --- a/composite/compoverlay.c +++ b/composite/compoverlay.c @@ -169,5 +169,5 @@ compDestroyOverlayWindow(ScreenPtr pScreen) CompScreenPtr cs = GetCompScreen(pScreen); cs->pOverlayWin = NullWindow; - FreeResource(cs->overlayWid, RT_NONE); + FreeResource(cs->overlayWid, X11_RESTYPE_NONE); } diff --git a/composite/compwindow.c b/composite/compwindow.c index c71a1fa7d..54afbdda0 100644 --- a/composite/compwindow.c +++ b/composite/compwindow.c @@ -610,9 +610,9 @@ compDestroyWindow(WindowPtr pWin) pScreen->DestroyWindow = cs->DestroyWindow; while ((cw = GetCompWindow(pWin))) - FreeResource(cw->clients->id, RT_NONE); + FreeResource(cw->clients->id, X11_RESTYPE_NONE); while ((csw = GetCompSubwindows(pWin))) - FreeResource(csw->clients->id, RT_NONE); + FreeResource(csw->clients->id, X11_RESTYPE_NONE); if (pWin->redirectDraw != RedirectDrawNone) { PixmapPtr pPixmap = (*pScreen->GetWindowPixmap) (pWin); |