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

Solaris 2.5 problem with Keysyms

Been fixing this everytime I compile a new version for a while, and thought
I'd finally speak up about it...

For some reason, XK_Page_Up and XK_Page_Down are not defined in
/usr/include/X11/keysymdef.h on my system. They need to be replaced by (or
defined the same as) XK_Prior and XK_Next.

And, with the newer versions, xsiag dies with many more undefined keysyms,
while the other applications don't have this problem. Here's the compiler

gcc -DHAVE_CONFIG_H -I. -I. -I.. -DNARROWPROTO          -Wall -g -O2 -c window.c
window.c: In function `KeyEventAction':
window.c:851: `XK_KP_Home' undeclared (first use this function)
window.c:851: (Each undeclared identifier is reported only once
window.c:851: for each function it appears in.)
window.c:853: `XK_KP_Left' undeclared (first use this function)
window.c:855: `XK_KP_Delete' undeclared (first use this function)
window.c:857: `XK_KP_Up' undeclared (first use this function)
window.c:859: `XK_KP_Right' undeclared (first use this function)
window.c:861: `XK_KP_Down' undeclared (first use this function)
window.c:863: `XK_KP_Page_Up' undeclared (first use this function)
window.c:864: `XK_Page_Up' undeclared (first use this function)
window.c:865: `XK_KP_Page_Down' undeclared (first use this function)
window.c:866: `XK_Page_Down' undeclared (first use this function)
window.c:867: `XK_KP_End' undeclared (first use this function)
gmake: *** [window.o] Error 1

My system is (uname -a)

SunOS fluvial 5.5 Generic sun4u sparc SUNW,Ultra-1

X appears to be X11R5, but the noted header file has a header date:

/* $XConsortium: keysymdef.h,v 1.14 91/02/14 15:26:22 rws Exp $ */


The other 2.5 machines here seem to have the same problem, but the 2.5.1
machines are fine, and use X11R6. 

I'm afraid I can't hack a change to configure.in that will fix this, but
here's a diff that fixes it for xsiag.

Since these are all used in a big case statement, my original intention of
just defining the ones I need in terms of the ones I have broke the case
statement. So, I fixed it by a REAL ugly hack, if they're not defined, define
them with the value from an updated version of keysymdef.h. 

This being my first real contribution to publicly developed software, I hope
this makes sense. I'm not sure how useful this will be, and this is probably
not a widespread problem. Below is the patch, although I think my diff(1)
output is different from the other patch (diff) files I've seen out there.

Andrew Gilmore

*** xsiag/window.c      Mon Jun 28 01:42:03 1999
--- fixed/xsiag/window.c        Fri Jul  2 15:03:30 1999
*** 29,34 ****
--- 29,72 ----
  #include <X11/cursorfont.h>
  #include <X11/keysym.h>
+ /* solve keysym problems with ancient X11/keysymdef.h file on Solaris 2.5 */
+ #ifndef XK_KP_Left
+ #define XK_KP_Left 0xFF96
+ #endif
+ #ifndef XK_KP_Right
+ #define XK_KP_Right 0xFF98
+ #endif
+ #ifndef XK_KP_Up
+ #define XK_KP_Up 0xFF97
+ #endif
+ #ifndef XK_KP_Down
+ #define XK_KP_Down 0xFF99
+ #endif
+ #ifndef XK_KP_Home
+ #define XK_KP_Home 0xFF95
+ #endif
+ #ifndef XK_KP_End
+ #define XK_KP_End 0xFF9C
+ #endif
+ #ifndef XK_Page_Up
+ #define XK_Page_Up XK_Prior
+ #endif
+ #ifndef XK_KP_Page_Up
+ #define XK_KP_Page_Up 0xFF9A
+ #endif
+ #ifndef XK_Page_Down
+ #define XK_Page_Down XK_Next
+ #endif
+ #ifndef XK_KP_Page_Down
+ #define XK_KP_Page_Down 0xFF9B
+ #endif
+ #ifndef XK_KP_Delete
+ #define XK_KP_Delete 0xFF9F
+ #endif
  #include <X11/IntrinsicP.h>   /* for XtResizeWidget */
  #include <X11/StringDefs.h>
  #include <X11/Xatom.h>