Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!tut.cis.ohio-state.edu!giza.cis.ohio-state.edu!frank From: frank@giza.cis.ohio-state.edu (Frank Adelstein) Newsgroups: comp.windows.x Subject: Re: Lex and X11/Xutil.h conflict Message-ID: <102367@tut.cis.ohio-state.edu> Date: 2 Apr 91 06:13:52 GMT References: <9103270244.AA02490@pelli> Sender: news@tut.cis.ohio-state.edu Organization: Ohio State Computer Science Lines: 37 In article <9103270244.AA02490@pelli> phils@athena.mit.EDU writes: >I'm having trouble getting Lex and to coexist. >I need to include in my lex file, but I'm having >trouble with lex wanting to do something like >#define input() ... while X11/Xutil.h has a record called "input" >in its XWMHints struct. > >Have others had this problem? What's the work-around? > >Philip Thompson >Dept. of Architecture and Urban Planning, MIT I had the same problem (though it was with X11/Intrinsic.h). The work-around we used (and there must be a better way) was to manually include the specific things that we needed from X11/Intrinsic.h (which in our case was Boolean, String and Widget). Here's what the top of our lex file looks like: %{ typedef char *String; typedef int Boolean; typedef void *Widget; /* #include #include */ #include "types.h" /* types and stuff used by our program */ #include "y.tab.h" %} I don't know what the "correct" way to do it would be (I think this would qualify as 'quick and dirty'). And the less that is defined, the less likely it'll break if the includes change. Hope this helps. --Frank Adelstein frank@cis.ohio-state.edu