Path: utzoo!news-server.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!ucselx!vaitl From: vaitl@ucselx.sdsu.edu (Eric Vaitl) Newsgroups: comp.lang.c++ Subject: Re: namespace (rethought & reiterated) Message-ID: <1991Mar9.114034.14249@ucselx.sdsu.edu> Date: 9 Mar 91 11:40:34 GMT References: <4196@lupine.NCD.COM> <5318@vela.acs.oakland.edu> <3353@litchi.bbn.com> Sender: vaitl@ucselx.sdsu.edu Organization: San Diego State University Computing Services Lines: 19 In article <3353@litchi.bbn.com> rsalz@bbn.com (Rich Salz) writes: >In <5318@vela.acs.oakland.edu> schemers@vela.acs.oakland.edu (Roland Schemers III) writes: >>I just had namespace pollution spoil my weekend. We just got in Motif >>from DEC, and it has C++ compatible headers, so I was all set to >>start hacking away... Till I noticed they had a 'typedef char *String;' > >Here's what I do when something like this happens: > #define String MOTIF_STRING > #include > #include > ... > #undef MOTIF_STRING >-- Does that really work? It looks like you are trying to use the preprocessor to undefine something that doesn't even exist until the typedef statement is compiled. If you have a compiler without a seperate preprocessor, I could imagine the undef statment removing MOTIF_STRING from the symbol table, but that would just be a bug in your compiler.