Skip to content

Commit a6c9ca1

Browse files
committed
composite: Introduce various macros that reflect the outdatedness of nx-libs's internal Xserver ABI.
1 parent e46ae9a commit a6c9ca1

File tree

6 files changed

+29
-25
lines changed

6 files changed

+29
-25
lines changed

nx-X11/programs/Xserver/composite/Imakefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,12 @@
1717
NX_DEFINES = -DNXAGENT_SERVER
1818
#endif
1919

20-
DEFINES = \
21-
$(NX_DEFINES) \
20+
DEFINES = \
21+
$(NX_DEFINES) \
22+
-DXSERVER_LACKS_DIXLOOKUP \
23+
-DXSERVER_LACKS_PRIVATES_ABI \
24+
-DXSERVER_LACKS_XACE_EXT \
25+
-DXSERVER_OLD_MEMFUNCS \
2226
$(NULL)
2327

2428
NormalLibraryTarget(composite,$(OBJS))

nx-X11/programs/Xserver/composite/compext.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@
3434

3535
static CARD8 CompositeReqCode;
3636

37-
#ifndef NXAGENT_SERVER
37+
#ifndef XSERVER_LACKS_PRIVATES_ABI
3838
static DevPrivateKeyRec CompositeClientPrivateKeyRec;
3939

4040
#define CompositeClientPrivateKey (&CompositeClientPrivateKeyRec)
41-
#else /* !defined(NXAGENT_SERVER) */
41+
#else /* !defined(XSERVER_LACKS_PRIVATES_ABI) */
4242
static int CompositeClientPrivIndex = -1;
43-
#endif /* !defined(NXAGENT_SERVER) */
43+
#endif /* !defined(XSERVER_LACKS_PRIVATES_ABI) */
4444

4545
RESTYPE CompositeClientWindowType;
4646
RESTYPE CompositeClientSubwindowsType;
@@ -51,13 +51,13 @@ typedef struct _CompositeClient {
5151
int minor_version;
5252
} CompositeClientRec, *CompositeClientPtr;
5353

54-
#ifndef NXAGENT_SERVER
54+
#ifndef XSERVER_LACKS_PRIVATES_ABI
5555
#define GetCompositeClient(pClient) ((CompositeClientPtr) \
5656
dixLookupPrivate(&(pClient)->devPrivates, CompositeClientPrivateKey))
57-
#else /* !defined(NXAGENT_SERVER) */
57+
#else /* !defined(XSERVER_LACKS_PRIVATES_ABI) */
5858
#define GetCompositeClient(pClient) ((CompositeClientPtr) \
5959
(pClient)->devPrivates[CompositeClientPrivIndex].ptr)
60-
#endif /* !edefined(NXAGENT_SERVER) */
60+
#endif /* !edefined(XSERVER_LACKS_PRIVATES_ABI) */
6161

6262
static void
6363
CompositeClientCallback (CallbackListPtr *list,
@@ -667,16 +667,16 @@ CompositeExtensionInit (void)
667667
if (!CompositeClientOverlayType)
668668
return;
669669

670-
#ifndef NXAGENT_SERVER
670+
#ifndef XSERVER_LACKS_PRIVATES_ABI
671671
if (!dixRegisterPrivateKey(&CompositeClientPrivateKeyRec, PRIVATE_CLIENT,
672672
sizeof (CompositeClientRec)))
673673
return;
674-
#else /* !defined(NXAGENT_SERVER) */
674+
#else /* !defined(XSERVER_LACKS_PRIVATES_ABI) */
675675
if ((CompositeClientPrivIndex = AllocateClientPrivateIndex()) < 0)
676676
return;
677677
if (!AllocateClientPrivate(CompositeClientPrivIndex, sizeof (CompositeClientRec)))
678678
return;
679-
#endif /* !defined(NXAGENT_SERVER) */
679+
#endif /* !defined(XSERVER_LACKS_PRIVATES_ABI) */
680680

681681
if (!AddCallback (&ClientStateCallback, CompositeClientCallback, 0))
682682
return;

nx-X11/programs/Xserver/composite/compinit.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@
2929
#include "compint.h"
3030
#include "compositeext.h"
3131

32-
#ifndef NXAGENT_SERVER
32+
#ifndef XSERVER_LACKS_PRIVATES_ABI
3333
DevPrivateKeyRec CompScreenPrivateKeyRec;
3434
DevPrivateKeyRec CompWindowPrivateKeyRec;
3535
DevPrivateKeyRec CompSubwindowsPrivateKeyRec;
36-
#else /* !defined(NXAGENT_SERVER) */
36+
#else /* !defined(XSERVER_LACKS_PRIVATES_ABI) */
3737
int CompScreenPrivIndex = -1;
3838
int CompWindowPrivIndex = -1;
3939
int CompSubwindowsPrivIndex = -1;
@@ -226,7 +226,7 @@ compRegisterAlternateVisuals(CompScreenPtr cs, VisualID * vids, int nVisuals)
226226
{
227227
VisualID *p;
228228

229-
#ifndef NXAGENT_SERVER
229+
#ifndef XSERVER_OLD_MEMFUNCS
230230
p = reallocarray(cs->alternateVisuals,
231231
cs->numAlternateVisuals + nVisuals, sizeof(VisualID));
232232
#else
@@ -261,7 +261,7 @@ CompositeRegisterImplicitRedirectionException(ScreenPtr pScreen,
261261
CompScreenPtr cs = GetCompScreen(pScreen);
262262
CompImplicitRedirectException *p;
263263

264-
#ifndef NXAGENT_SERVER
264+
#ifndef XSERVER_OLD_MEMFUNCS
265265
p = reallocarray(cs->implicitRedirectExceptions,
266266
cs->numImplicitRedirectExceptions + 1, sizeof(p[0]));
267267
#else
@@ -381,14 +381,14 @@ compScreenInit (ScreenPtr pScreen)
381381
{
382382
CompScreenPtr cs;
383383

384-
#ifndef NXAGENT_SERVER
384+
#ifndef XSERVER_LACKS_PRIVATES_ABI
385385
if (!dixRegisterPrivateKey(&CompScreenPrivateKeyRec, PRIVATE_SCREEN, 0))
386386
return FALSE;
387387
if (!dixRegisterPrivateKey(&CompWindowPrivateKeyRec, PRIVATE_WINDOW, 0))
388388
return FALSE;
389389
if (!dixRegisterPrivateKey(&CompSubwindowsPrivateKeyRec, PRIVATE_WINDOW, 0))
390390
return FALSE;
391-
#else /* !defined(NXAGENT_SERVER) */
391+
#else /* !defined(XSERVER_LACKS_PRIVATES_ABI) */
392392
if ((CompScreenPrivIndex = AllocateScreenPrivateIndex()) < 0)
393393
return FALSE;
394394
if ((CompWindowPrivIndex = AllocateWindowPrivateIndex()) < 0)

nx-X11/programs/Xserver/composite/compint.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ typedef struct _CompScreen {
160160
SourceValidateProcPtr SourceValidate;
161161
} CompScreenRec, *CompScreenPtr;
162162

163-
#ifndef NXAGENT_SERVER
163+
#ifndef XSERVER_LACKS_PRIVATES_ABI
164164
extern DevPrivateKeyRec CompScreenPrivateKeyRec;
165165

166166
#define CompScreenPrivateKey (&CompScreenPrivateKeyRec)
@@ -179,33 +179,33 @@ extern DevPrivateKeyRec CompSubwindowsPrivateKeyRec;
179179
dixLookupPrivate(&(w)->devPrivates, CompWindowPrivateKey))
180180
#define GetCompSubwindows(w) ((CompSubwindowsPtr) \
181181
dixLookupPrivate(&(w)->devPrivates, CompSubwindowsPrivateKey))
182-
#else /* !defined(NXAGENT_SERVER) */
182+
#else /* !defined(XSERVER_LACKS_PRIVATES_ABI) */
183183
extern int CompScreenPrivIndex;
184184
extern int CompWindowPrivIndex;
185185
extern int CompSubwindowsPrivIndex;
186186

187187
#define GetCompScreen(s) ((CompScreenPtr) (s)->devPrivates[CompScreenPrivIndex].ptr)
188188
#define GetCompWindow(w) ((CompWindowPtr) (w)->devPrivates[CompWindowPrivIndex].ptr)
189189
#define GetCompSubwindows(w) ((CompSubwindowsPtr) (w)->devPrivates[CompSubwindowsPrivIndex].ptr)
190-
#endif /* !defined(NXAGENT_SERVER) */
190+
#endif /* !defined(XSERVER_LACKS_PRIVATES_ABI) */
191191

192192
extern RESTYPE CompositeClientSubwindowsType;
193193
extern RESTYPE CompositeClientOverlayType;
194194

195195
/* Shim for less ifdefs within the actual code. */
196-
#ifndef NXAGENT_SERVER
196+
#ifndef XSERVER_LACKS_PRIVATES_ABI
197197
#define FAKE_DIX_SET_PRIVATE_IMPL(obj, privateKey, ptr_val) do { dixSetPrivate(&(obj)->devPrivates, privateKey, ptr_val); } while (0)
198198

199199
#define FAKE_DIX_SET_SCREEN_PRIVATE(pScreen, ptr_val) FAKE_DIX_SET_PRIVATE_IMPL(pScreen, CompScreenPrivateKey, ptr_val)
200200
#define FAKE_DIX_SET_WINDOW_PRIVATE(pWin, ptr_val) FAKE_DIX_SET_PRIVATE_IMPL(pWin, CompWindowPrivateKey, ptr_val)
201201
#define FAKE_DIX_SET_SUBWINDOWS_PRIVATE(pWin, ptr_val) FAKE_DIX_SET_PRIVATE_IMPL(pWin, CompSubwindowsPrivateKey, ptr_val)
202-
#else /* !defined(NXAGENT_SERVER) */
202+
#else /* !defined(XSERVER_LACKS_PRIVATES_ABI) */
203203
#define FAKE_DIX_SET_PRIVATE_IMPL(obj, privIndex, ptr_val) do { (obj)->devPrivates[privIndex].ptr = (void *) (ptr_val); } while (0)
204204

205205
#define FAKE_DIX_SET_SCREEN_PRIVATE(pScreen, ptr_val) FAKE_DIX_SET_PRIVATE_IMPL(pScreen, CompScreenPrivIndex, ptr_val)
206206
#define FAKE_DIX_SET_WINDOW_PRIVATE(pWin, ptr_val) FAKE_DIX_SET_PRIVATE_IMPL(pWin, CompWindowPrivIndex, ptr_val)
207207
#define FAKE_DIX_SET_SUBWINDOWS_PRIVATE(pWin, ptr_val) FAKE_DIX_SET_PRIVATE_IMPL(pWin, CompSubwindowsPrivIndex, ptr_val)
208-
#endif /* !defined(NXAGENT_SERVER) */
208+
#endif /* !defined(XSERVER_LACKS_PRIVATES_ABI) */
209209

210210
/*
211211
* compalloc.c

nx-X11/programs/Xserver/composite/compoverlay.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
#endif
4747

4848
#include "compint.h"
49-
#ifndef NXAGENT_SERVER
49+
#ifndef XSERVER_LACKS_XACE_EXT
5050
#include "xace.h"
5151
#endif
5252

nx-X11/programs/Xserver/composite/compwindow.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ static Bool
7878
compRepaintBorder (ClientPtr pClient, void * closure)
7979
{
8080
WindowPtr pWindow;
81-
#ifndef NXAGENT_SERVER
81+
#ifndef XSERVER_LACKS_DIXLOOKUP
8282
int rc =
8383
dixLookupWindow(&pWindow, (XID) (intptr_t) closure, pClient,
8484
DixWriteAccess);

0 commit comments

Comments
 (0)