Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!sdd.hp.com!spool2.mu.edu!news.cs.indiana.edu!ariel.unm.edu!triton.unm.edu!lriffe From: lriffe@triton.unm.edu (Larry Riffe II) Newsgroups: comp.windows.x Subject: Re: Can't build qdss on VAX under Ultrix 4.X Message-ID: <1990Dec19.173749.25314@ariel.unm.edu> Date: 19 Dec 90 17:37:49 GMT References: <71012@bu.edu.bu.edu> Sender: news@ariel.unm.edu (News supported software) Organization: University of New Mexico, Albuquerque NM Lines: 109 Brian, There is indeed a problem with the 2 lines you mention, but the problem is not with the third variable, its with the second. It appears that this is not caused so much by a bug but more by changes DEC made to their OS that MIT doesn't know about. Follow along and I'll explain: In mit/server/ddx/dec/qdss/qdss_io.c we have the following lines: if (on != SCREEN_SAVER_ON) { lastEventTime = GetTimeInMillis(); if (!Vaxstar) *(short *) Qdss.memcsr = UNBLANK | SYNC_ON; else ioctl(fd_qdss, SG_VIDEOON, &Sg); /* <= ERRORS HERE */ } else { if (!Vaxstar) *(short *) Qdss.memcsr = SYNC_ON; else ioctl(fd_qdss, SG_VIDEOOFF, &Sg); /* <= ERRORS HERE */ } With the errors you mentioned occurring on the lines that are pointed to. In mit/server/ddx/dec/qdss/libtl/tl.h we have: #ifdef __STDC__ #define SG_MAPDEVICE _IOR('g', 9, struct sgmap) /* map device to user */ #define SG_VIDEOON _IO('g',23) /* turn on the video */ #define SG_VIDEOOFF _IO('g',24) /* turn off the video */ #define SG_CURSORON _IO('g',25) /* turn on the cursor */ #define SG_CURSOROFF _IO('g',26) /* turn off the cursor */ #else #define SG_MAPDEVICE _IOR(g, 9, struct sgmap) /* map device to user */ #define SG_VIDEOON _IO(g,23) /* turn on the video */ #define SG_VIDEOOFF _IO(g,24) /* turn off the video */ #define SG_CURSORON _IO(g,25) /* turn on the cursor */ #define SG_CURSOROFF _IO(g,26) /* turn off the cursor */ #endif And this is where the problem happens! The variable __STDC__ is supposed to be defined as 1 if the C compiler is ANSI C compliant! DEC's is not and thus this defines the second set of variables instead of the first set. Now _IO is defined in /usr/include/sys/ioctl.h! And DEC decided to change this definition between Ultrix 3.1 and 4.0. Thus causing the problem your having. Ultrix 3.1 /usr/include/sys/ioctl.h: #define _IO(x,y) (int)(IOC_VOID|('x'<<8)|y) And Ultrix 4.0 /usr/include/sys/ioctl.h: #define _IO(x,y) (int)(_IOC_VOID|(x<<8)|y) If you notice, there are no ' around the x variable. So, that means we have to define our original variables (the ones from /mit/server/ddx/dec/qdss/libtl/tl.h) as if we are using an ANSI C compliant compiler. But, since we are not using an ANSI C compliant compiler (I've heard that DEC is working on this, but so far, their C compiler is not) we get an error and the color X server doesn't build for a VAX arch. machine. So, the question is how to fix this. I've come up with two methods, the first I don't know how to implement and the second which is a hack but does happen to work. The first method involves modifying the imakefile so that it will compile all of the source code in mit/server/ddx/dec/qdss with the option -DOSMajorVersion=???. Then change the #ifdef in mit/server/ddx/dec/qdss/libtl/tl.h to look like: #if ( (__STDC__) || ( OSMajorVersion > 3 ) ) The only problem with this, is that I don't know how to modify the imakefile to compile everything with the option I specified above! Is there anybody out there who can tell me what needs to be changed to do this? The second method is a hack, I don't like it, but it's quick and it works. The first thing is to make a backup copy of mit/server/ddx/dec/qdss/libtl/tl.h. Then edit the copy in your source tree so that there is no longer a #ifdef and you only define the correct variables. i.e. #define SG_MAPDEVICE _IOR('g', 9, struct sgmap) /* map device to user */ #define SG_VIDEOON _IO('g',23) /* turn on the video */ #define SG_VIDEOOFF _IO('g',24) /* turn off the video */ #define SG_CURSORON _IO('g',25) /* turn on the cursor */ #define SG_CURSOROFF _IO('g',26) /* turn off the cursor */ Make sure you keep a backup copy of this file so that you can put it back in place after you have compiled the server code. Hope this helps, Larry G. Riffe II lriffe@triton.unm.edu lriffe@triton.cirt.unm.edu