Compare commits

...

1 Commits

Author SHA1 Message Date
Enrico Weigelt, metux IT consult 9808fab0a2 Xnest: drop hack for building 32bit server against 64bit libs
Xnest.h contains a weird historical hack for building 32bit server with 64bit
libraries. It redeclares a bunch of stanard X types (eg. from Xdefs.h) to
32 bit size. Those hacks are ugly to maintain and can easily cause trouble
(eg. if include order gets mixed up). And it's not at all needed anyways.

Those kind of situations are easily solved, in a much more robust way:
just run build the build it in a chroot or container, or do a pretty
boring usual crosscompile.

No need to carry special hacks for things that already done out-of-the-box
by proper tooling / build environment.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-04-25 19:51:12 +02:00
3 changed files with 0 additions and 114 deletions

View File

@ -217,22 +217,8 @@ xnestSetInstalledColormapWindows(ScreenPtr pScreen)
if (!xnestSameInstalledColormapWindows(icws.windows, icws.numWindows)) { if (!xnestSameInstalledColormapWindows(icws.windows, icws.numWindows)) {
free(xnestOldInstalledColormapWindows); free(xnestOldInstalledColormapWindows);
#ifdef _XSERVER64
{
int i;
Window64 *windows = xallocarray(numWindows, sizeof(Window64));
for (i = 0; i < numWindows; ++i)
windows[i] = icws.windows[i];
XSetWMColormapWindows(xnestDisplay,
xnestDefaultWindows[pScreen->myNum], windows,
numWindows);
free(windows);
}
#else
XSetWMColormapWindows(xnestDisplay, xnestDefaultWindows[pScreen->myNum], XSetWMColormapWindows(xnestDisplay, xnestDefaultWindows[pScreen->myNum],
icws.windows, numWindows); icws.windows, numWindows);
#endif
xnestOldInstalledColormapWindows = icws.windows; xnestOldInstalledColormapWindows = icws.windows;
xnestNumOldInstalledColormapWindows = icws.numWindows; xnestNumOldInstalledColormapWindows = icws.numWindows;
@ -274,19 +260,8 @@ xnestSetScreenSaverColormapWindow(ScreenPtr pScreen)
{ {
free(xnestOldInstalledColormapWindows); free(xnestOldInstalledColormapWindows);
#ifdef _XSERVER64
{
Window64 window;
window = xnestScreenSaverWindows[pScreen->myNum];
XSetWMColormapWindows(xnestDisplay, xnestDefaultWindows[pScreen->myNum],
&window, 1);
xnestScreenSaverWindows[pScreen->myNum] = window;
}
#else
XSetWMColormapWindows(xnestDisplay, xnestDefaultWindows[pScreen->myNum], XSetWMColormapWindows(xnestDisplay, xnestDefaultWindows[pScreen->myNum],
&xnestScreenSaverWindows[pScreen->myNum], 1); &xnestScreenSaverWindows[pScreen->myNum], 1);
#endif /* _XSERVER64 */
xnestOldInstalledColormapWindows = NULL; xnestOldInstalledColormapWindows = NULL;
xnestNumOldInstalledColormapWindows = 0; xnestNumOldInstalledColormapWindows = 0;
@ -389,25 +364,8 @@ void
xnestStoreColors(ColormapPtr pCmap, int nColors, xColorItem * pColors) xnestStoreColors(ColormapPtr pCmap, int nColors, xColorItem * pColors)
{ {
if (pCmap->pVisual->class & DynamicClass) if (pCmap->pVisual->class & DynamicClass)
#ifdef _XSERVER64
{
int i;
XColor *pColors64 = xallocarray(nColors, sizeof(XColor));
for (i = 0; i < nColors; ++i) {
pColors64[i].pixel = pColors[i].pixel;
pColors64[i].red = pColors[i].red;
pColors64[i].green = pColors[i].green;
pColors64[i].blue = pColors[i].blue;
pColors64[i].flags = pColors[i].flags;
}
XStoreColors(xnestDisplay, xnestColormap(pCmap), pColors64, nColors);
free(pColors64);
}
#else
XStoreColors(xnestDisplay, xnestColormap(pCmap), XStoreColors(xnestDisplay, xnestColormap(pCmap),
(XColor *) pColors, nColors); (XColor *) pColors, nColors);
#endif
} }
void void

View File

@ -129,26 +129,9 @@ xnestKeyboardProc(DeviceIntPtr pDev, int onoff)
switch (onoff) { switch (onoff) {
case DEVICE_INIT: case DEVICE_INIT:
XDisplayKeycodes(xnestDisplay, &min_keycode, &max_keycode); XDisplayKeycodes(xnestDisplay, &min_keycode, &max_keycode);
#ifdef _XSERVER64
{
KeySym64 *keymap64;
int len;
keymap64 = XGetKeyboardMapping(xnestDisplay,
min_keycode,
max_keycode - min_keycode + 1,
&mapWidth);
len = (max_keycode - min_keycode + 1) * mapWidth;
keymap = xallocarray(len, sizeof(KeySym));
for (i = 0; i < len; ++i)
keymap[i] = keymap64[i];
XFree(keymap64);
}
#else
keymap = XGetKeyboardMapping(xnestDisplay, keymap = XGetKeyboardMapping(xnestDisplay,
min_keycode, min_keycode,
max_keycode - min_keycode + 1, &mapWidth); max_keycode - min_keycode + 1, &mapWidth);
#endif
memset(modmap, 0, sizeof(modmap)); memset(modmap, 0, sizeof(modmap));
modifier_keymap = XGetModifierMapping(xnestDisplay); modifier_keymap = XGetModifierMapping(xnestDisplay);

View File

@ -28,63 +28,8 @@ from the X Consortium.
*/ */
/*
** Machines with a 64 bit library interface and a 32 bit server require
** name changes to protect the guilty.
*/
#ifdef _XSERVER64
#define _XSERVER64_tmp
#undef _XSERVER64
typedef unsigned long XID64;
typedef unsigned long Mask64;
typedef unsigned long Atom64;
typedef unsigned long VisualID64;
typedef unsigned long Time64;
#define XID XID64
#define Mask Mask64
#define Atom Atom64
#define VisualID VisualID64
#define Time Time64
typedef XID Window64;
typedef XID Drawable64;
typedef XID Font64;
typedef XID Pixmap64;
typedef XID Cursor64;
typedef XID Colormap64;
typedef XID GContext64;
typedef XID KeySym64;
#define Window Window64
#define Drawable Drawable64
#define Font Font64
#define Pixmap Pixmap64
#define Cursor Cursor64
#define Colormap Colormap64
#define GContext GContext64
#define KeySym KeySym64
#endif /*_XSERVER64*/
#define GC XlibGC #define GC XlibGC
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include <X11/Xutil.h> #include <X11/Xutil.h>
#include <X11/extensions/shape.h> #include <X11/extensions/shape.h>
#undef GC #undef GC
#ifdef _XSERVER64_tmp
#define _XSERVER64
#undef _XSERVER64_tmp
#undef XID
#undef Mask
#undef Atom
#undef VisualID
#undef Time
#undef Window
#undef Drawable
#undef Font
#undef Pixmap
#undef Cursor
#undef Colormap
#undef GContext
#undef KeySym
#endif /*_XSERVER64_tmp*/