Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!elroy.jpl.nasa.gov!jpl-devvax!lwall From: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Newsgroups: comp.unix.questions Subject: Re: Using (abusing) cpp... Message-ID: <7743@jpl-devvax.JPL.NASA.GOV> Date: 11 Apr 90 20:48:26 GMT References: <1990Apr11.192909.26527@IDA.ORG> <3359@jato.Jpl.Nasa.Gov> Reply-To: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Organization: Jet Propulsion Laboratory, Pasadena, CA Lines: 47 In article <3359@jato.Jpl.Nasa.Gov> hashem@mars.jpl.nasa.gov (Basil Hashem) writes: : I'm using the cpp program (the SunOS C pre-processor) for filtering some : files which are not C programs. : : I have been successful in doing #include's, #ifdef's, and #defines's. What I : need to do is pass a file such as the following through cpp. (Don't worry : about the extra lines and comment lines that cpp generates.) : : ---- : #define LANGUAGE English : : #if (LANGUAGE == French) : #define GREETING Bonjour : #define FAREWELL Salut : #define GENTLEMEN Monsieurs : #else : #define GREETING Good Morning : #define FAREWELL Bye : #define GENTLEMEN Sirs : #endif : : Dear GENTELMEN, : : GREETING : : blah blah : : FAREWELL : ---- : : The results are not what is expected since cpp doesn't do the compare properly. : What I really need is a strcmp(LANGUAGE, "French") but I can't really do : that considering this is not C. #define English 1 #define French 2 #define Spanish 3 #define Basque 4 #define LANGUAGE Basque #if LANGUAGE == Basque #define GREETING Agur! #endif Larry Wall lwall@jpl-devvax.jpl.nasa.gov