bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Emacs 21.1 bug on solaris 2.5.1


From: Paananen Mikko
Subject: Emacs 21.1 bug on solaris 2.5.1
Date: Thu, 25 Oct 2001 13:04:26 +0300 (EEST)

Hello,

Emacs 21.1 doesn't compile out-of-the-box on solaris 2.5.1.

Problems is in src/xfns.c, function XScreenNumberOfScreen, it is not
used if X11 has same function defined, however with X11R5 function is
needed but doesn't compile.

#ifndef HAVE_XSCREENNUMBEROFSCREEN

/* Value is the screen number of screen SCR.  This is a substitute for
   the X function with the same name when that doesn't exist.  */

int
XScreenNumberOfScreen (scr)
    register Screen *scr;
{
  Display *dpy = scr->display;
  int i;

  for (i = 0; i < dpy->nscreens; ++i)
    if (scr == dpy->screens[i]) /* FAILING LINE */
      break;

  return i;
}

in Xlib.h Display struct is defined:
typedef struct _XDisplay {
        ...
        int nscreens;           /* number of screens on this server*/
        Screen *screens;        /* pointer to list of screens */
        ..

So there is a compare between pointer and struct. Here's my fix, which
seemed to compile and work during couple of hours testing.

--- xfns.c~     Tue Sep 25 20:42:49 2001
+++ xfns.c      Thu Oct 25 07:07:52 2001
@@ -4963,7 +4963,7 @@
   int i;
 
   for (i = 0; i < dpy->nscreens; ++i)
-    if (scr == dpy->screens[i])
+    if (scr == &(dpy->screens[i]))
       break;
 
   return i;

XFree86 also implements same code, but differently.

-- 
Mikko Paananen                          <Mikko.Paananen@cs.tut.fi>
Administrator @ cs.tut.fi               Phone: +358 3 365 3813
Tampere University of Technology        Room: Hermitec/HC222



reply via email to

[Prev in Thread] Current Thread [Next in Thread]