I think the point we're making is that the call to InterlockedCompareExchange that is in that code will never happen since the first part of the #ifdef is always satisfied for all windows platforms because _MSC_VER is always defined. I believe Borland even defines it. So the suggestion would be to drop the InterlockedCompareExchange (not suggested) or change the _MSC_VER to check version info or some other variable to detect which os you are compiling on. If you are building with msvc you ought to be using InterlockedCompareExchange .
> -----Original Message----- > From: David N Bertoni/Cambridge/IBM [mailto:[EMAIL PROTECTED] > Sent: Friday, March 14, 2003 11:37 AM > > 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. And if you build with MSVC on NT and run on NT you still get the inline assy. If you build with MSVC on '95 and run on NT you still get inline assy. You build with Borland or other compilers you still get the inline assy. You never get to use InterlockedCompareExchange . That is the whole point. The call is superfluous. Bob > > Dave > > > > > > > <[EMAIL PROTECTED] > > > ngcast.com> To: > <[EMAIL PROTECTED]> > > cc: (bcc: > David N Bertoni/Cambridge/IBM) > > 03/14/2003 08:16 Subject: > XMLPlatformUtils::compareAndSwap fn > > AM > > > Please respond > > > to xerces-c-dev > > > > > > > > > I was just following up on my previous reply and was puzzled by the > implementation of this fn. > > ... > > here, the developer has used #if defined(_MSC_VER) to branch to his inline > assembly code. But _MSC_VER is ALWAYS defined on Most windows > versions. So, > I guess we would always be hitting the assembly code (unless you are using > win64). Does someone think this if define condition needs modifying ? we > may probably want to use _WIN32_WINNT or atleast check if _MSC_VER > 1000 > or something like that. > > -Vinayak > > --------------------------------------------------------------------- > 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
