Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!sun-barr!newstop!sun!satori!dmc From: dmc%satori@Sun.COM (Doug Cook) Newsgroups: comp.windows.x Subject: Re: Problem Compiling XView Message-ID: <124660@sun.Eng.Sun.COM> Date: 13 Sep 89 22:23:14 GMT References: <11762@polya.Stanford.EDU> Sender: news@sun.Eng.Sun.COM Reply-To: dmc@sun.UUCP (Doug Cook) Organization: Sun Microsystems, Mountain View Lines: 96 In article <11762@polya.Stanford.EDU> lma@Polya.Stanford.EDU (Larry M. Augustin) writes: > >On a Sun 3/110, SunOS 3.5. > >I get the following error messages during compilation: [...] >The only definitions that I can find for FD_SETSIZE, NFDBITS, and NBBY are in >ultrix_cpt.h, which is probably not the right file to use on a Sun 3! > >I have this nagging feeling that I'm doing something wrong in the >compilation, but I don't know what. Could someone who has built XView >tell me where these are defined? Thanks. No, if you got that far, then you're compiling XView properly. The problem is that the XView notifier code makes rather extensive use of the FD_SETSIZE, etc. macros, which are new to 4.3BSD. Systems such as 4.2BSD, SunOS3.X and Ultrix 2.X don't have them. The file ultrix_cpt.h is an attempt to provide these macros to VAXen running older versions of Ultrix. As originally shipped, it's rather primitive. I've rewritten this file to work for other 4.2-based platforms as well. Since it's a short file, I've simply appended it to my message. To enable the code, define the compile-time flag OLD_BSD_FDSETS. Please let me know if it works properly on your 3.5 system, since I don't have a 3.5 system here to test it with. -Doug Doug Cook (dmc@sun.com) Software Engineer, XView Group This space intentionally left blank. Sun Microsystems, Inc. --------------------------------- CUT HERE --------------------------------- /* %Z%%M% %I% %E% SMI */ /* * (c) Copyright 1989 Sun Microsystems, Inc. Sun design patents * pending in the U.S. and foreign countries. See LEGAL NOTICE * file for terms of the license. */ /* * Ultrix 2.X, SunOS 3.X, BSD 4.2 Compatibility Header File * * This file provides a limited compatibility with older BSD variants * that do not provide macros for dealing with fd sets. * * BIG NOTE!!! This will only allow fd_sets of N bits , where N is * the size of an int. * */ #ifndef xview_ultrix_compat_DEFINED #define xview_ultrix_compat_DEFINED #ifdef OLD_BSD_FDSETS #ifndef NBBY #define NBBY 8 /* number of bits in a byte */ #endif #ifndef NFDBITS #define NFDBITS (sizeof(int) * NBBY) #define I_DEFINED_NFDBITS /* register the fact that I defined this */ #endif #ifndef FD_SETSIZE #define FD_SETSIZE NFDBITS #define I_DEFINED_FDSETSIZE /* register the fact that I defined this */ #endif /* * Here we assume that the only use of howmany(x, y) is * howmany(FD_SETSIZE, NFDBITS). If we defined both FD_SETSIZE and * NFDBITS, then we already know what howmany(x, y) will be: 1. * If we did not define FD_SETSIZE and NFDBITS, then we'll have * to calculate the value of howmany(x, y). */ #if defined(I_DEFINED_FDSETSIZE) && defined(I_DEFINED_NFDBITS) #define howmany(x, y) 1 #else #define howmany(x, y) (((x)+((y)-1))/(y)) #endif #define FD_SET(n, p) ((p)->fds_bits[0] |= (1 << ((n) % NFDBITS))) #define FD_CLR(n, p) ((p)->fds_bits[0] &= ~(1 << ((n) % NFDBITS))) #define FD_ISSET(n, p) ((p)->fds_bits[0] & (1 << ((n) % NFDBITS))) #define FD_ZERO(p) ((p)->fds_bits[0] = 0) #endif OLD_BSD_FDSETS #endif ~xview_ultrix_compat_DEFINED