Re: [ROOT] Root Conflicts with Windows

From: Fons Rademakers (Fons.Rademakers@cern.ch)
Date: Fri Sep 29 2000 - 10:36:19 MEST


Hi Jonathan,

   have a look at:

http://root.cern.ch/lxr/source/base/inc/Windows4Root.h

to see which Win32 defines we had to undefine.

Cheers, Fons.


On Thu, Sep 28, 2000 at 11:00:27AM -0500, Jonathan M. Gilligan wrote:
> At 04:59 AM 9/27/2000, you wrote:
> >    like discussed in this thread there are two independent issues at
> >stake. First MS has the habit to create defines for absolutely trivial
> >words (like #define Create CreateA) making sure that all code using the
> >word Create will be morphed and will fail to compile. To be safe one has to
> >create files which #undef half of all know common english words.
> 
> This is true only for a very small English vocabulary. In fact, if you grep 
> all the MS header files for "^\s*#\s*define\s+[A-Za-z][a-z]*(\s|$)" and 
> pipe the resulting symbols through a dictionary lookup, you find the 
> following 14 words:
> 
> Word            File
> --------------------------
> Workstation     FMI.H
> and             ISO646.H
> complex         MATH.H
> environ         STDLIB.H
> except          SEHMAP.H
> finally         SEHMAP.H
> hyper           RPCNDR.H
> leave           SEHMAP.H
> new             AFXTEMPL.H
> not             ISO646.H
> or              ISO646.H
> rh              FMI.H
> small           RPCNDR.H
> try             SEHMAP.H
> 
> so if you follow standard C/C++ idioms and assume that any identifier with 
> all uppercase letters may have been defined for the preprocessor, then you 
> are left with a set of 14 words that you have to watch out for. Moreover, 
> four of these words are mandated by the ANSI/ISO standards and two more are 
> transparent redefines of C++ keywords for debugging purposes, so you really 
> only need worry about eight words. That's not so hard, is it?
> 
> In my practice, I have had more problems with other libraries such as ZLib 
> and libjpeg that #define symbols such as INT32 that are typedef'ed by MS, 
> than I have had trouble with MS #defines colliding with others' symbols.
> 
> Jonathan
> 
> ===========================================================================
> Jonathan M. Gilligan                     <jonathan.gilligan@vanderbilt.edu>

-- 
Org:    CERN, European Laboratory for Particle Physics.
Mail:   1211 Geneve 23, Switzerland
E-Mail: Fons.Rademakers@cern.ch              Phone: +41 22 7679248
WWW:    http://root.cern.ch/~rdm/            Fax:   +41 22 7677910



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:34 MET