Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!unisoft!mcfong From: mcfong@unisoft.UUCP (Martin C. Fong) Newsgroups: comp.windows.x Subject: Re: X11R3 on Pyramid Message-ID: <2037@unisoft.UUCP> Date: 6 May 89 20:21:01 GMT References: <8905051503.AA07259@expo.lcs.mit.edu> Reply-To: mcfong@unisoft.UUCP (Martin C. Fong) Lines: 66 In article <8905051503.AA07259@expo.lcs.mit.edu> S.Davey@CS.UCL.AC.UK writes: > > [ ... stuff deleted ... ] > >The compiler fails on >AsciiSink.c and complains that line 58 of TextSrcP.h has >a missing semi-colon but on investigation there is no >missing semi-colon. > > [ ... stuff deleted ... ] > >Steve Davey >Systems Group >Dept Computer Science >University College London >tel +44-1-380-7280 >email S.Davey@cs.ucl.ac.uk The Pyramid C compiler has some trouble with a traditional pointer to function declaration (ie. " int (*foo)(); ") within a structure declaration. The problem appears to be a variable/type name space scoping problem. For example, the following will not work: typedef int foo; typedef struct bar { int (*foo)(); }; The new type "foo" for some reasons collides with the structure variable "foo". However, this code will work if re-written as: typedef int foo; + typedef (*IntFuPtr)(); typedef struct bar { ! IntFuPtr foo; }; Below is my patch to "TextSrcP.h" which will work around this problem. I don't seem to have any trouble with "AsciiSink.c". Care to elaborate on what the compiler burped on? *** TextSrcP.h.old Sat May 6 12:23:30 1989 --- TextSrcP.h.new Sat May 6 12:21:47 1989 *************** *** 52,61 **** --- 52,69 ---- caddr_t data; }; + #ifdef pyr + typedef int (*IntFuPtr) (); + #endif pyr + typedef struct _XtTextSink { XFontStruct *font; int foreground; + #ifdef pyr + IntFuPtr Display; + #else pyr int (*Display)(); + #endif pyr int (*InsertCursor)(); int (*ClearToBackground)(); int (*FindPosition)();