Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!decwrl!uunet!auspex!guy From: guy@auspex.auspex.com (Guy Harris) Newsgroups: comp.windows.x Subject: Re: warning in compiling sunKbd.c in SunOS 4.1 make world Keywords: X11R4 make, warning, Sun, keyboard Message-ID: <4167@auspex.auspex.com> Date: 8 Oct 90 23:34:31 GMT References: <1990Oct7.183002.11878@elroy.jpl.nasa.gov> Organization: Auspex Systems, Santa Clara Lines: 48 >I still have a lot more work to do to get the installation complete, but >this (obviously) bothers me. I have no clue what to do about it. Any >information on the topic would be helpful. The problem is that in SunOS 4.1, the keyboard driver was changed so that translation table entries are 16 bits long, rather than 8 bits, so that translation table entries can contain ISO Latin #1 characters plus a whole bunch of special functions, rather than just ASCII characters plus special functions, and the codes for the special functions were changed. New "ioctl"s were added to read 16-bit translation table entries; the old "ioctl"s are still there, and attempt to map a new-style translation table entry to an old-style one. So one solution would be to replace HOLE in the line if (key.kio_entry != HOLE) with 0xA2; since it's fetching the entry with the old-style "ioctl", it should compare it with the old-style value for HOLE. This should work, although I've not tried compiling it; I *have* run a server built under 4.0.3 on a 4.1 machine, but that code doesn't come into play anyway, because under 4.1 the KIOCGTYPE "ioctl" doesn't lie about Type 4s, it says they're Type 4s. Another solution is simply to un-define TYPE4KEYBOARDOVERRIDE when building under 4.1, since, as I said, the 4.1 driver says Type 4s are Type 4s and you don't have to kludge around to find out whether something it says is a Type 3 is really a Type 4. (We don't count Type 4s with the DIP switches set to tell it to say to the OS that it's a Type 3; there's not much we can do about them.) I'd be inclined to go with the second solution, as there's no guarantee that, if you build your server under 4.1, it'll run on a 4.0[.x] machine *anyway*. Try something such as /* * The Sun 386i has system include files that preclude this pre SunOS 4.1 * test for the presence of a type 4 keyboard however it really doesn't * matter since no 386i has ever been shipped with a type 3 keyboard. */ #if !defined(i386) && OSMajorVersion == 4 && OSMinorVersion == 0 #define TYPE4KEYBOARDOVERRIDE #endif so that TYPE4KEYBOARDOVERRIDE is only enabled under 4.0[.x] on non-386i machines, not on pre-4.0 machines, 386i's, or 4.1 machines.