Hi Vinayak,

The comment is explicit about why the ifdef is there:

    //  If you are willing to give up Win95 support change this to #if 0
    //  otherwise we are back to using assembler.
    //  (But only if building with compilers that support inline
assembler.)

In other words, some day, when Windows 95 is dead and gone, change:

    #if defined(_MSC_VER) || defined(__BCPLUSPLUS__)

to:

    #if 0

and you won't need inline assembler any more.  Or, if your compiler doesn't
support inline assembler, you can do the same thing, with the caveat that
the library won't run on Win95.

Dave



                                                                                       
                                                        
                      <[EMAIL PROTECTED]                                               
                                                          
                      ngcast.com>              To:      <[EMAIL PROTECTED]>            
                                              
                                               cc:      (bcc: David N 
Bertoni/Cambridge/IBM)                                                   
                      03/14/2003 09:26         Subject: RE: 
XMLPlatformUtils::compareAndSwap fn                                                
                      AM                                                               
                                                        
                      Please respond                                                   
                                                        
                      to xerces-c-dev                                                  
                                                        
                                                                                       
                                                        



> The whole point of the ifdef is that all Windows builds use the inline
> assembly code.

Got it. But then all we needed was

#ifdef WIN64
InterlockedCompareExchangePointer(..)
#else
assembly code
#endif

Because this entire class (under Win32PlatformUtils.cpp) is going to be
used only by windows clients, I guess.

The code is not wrong, per se. But the intention behind the coding is
slightly confusing because the call to the ::InterlockedCompareExchange at
the bottom now belongs to the domain of unreachable code :-).

Regards,
-Vinayak

> -----Original Message-----
> From: David N Bertoni/Cambridge/IBM
> [mailto:[EMAIL PROTECTED]
> Sent: Friday, March 14, 2003 11:37 AM
> To: [EMAIL PROTECTED]
> Subject: Re: XMLPlatformUtils::compareAndSwap fn
>
>
>
>
>
>
> The whole point of the ifdef is that all Windows builds use the inline
> assembly code.  The ifdef is checked at compile time, but the
> assumption is
> you would want to build on NT or Win2000, but run on Windows 95.
>
> Dave

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to