You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xerces.apache.org by Gareth Reakes <ga...@decisionsoft.com> on 2000/03/02 18:54:41 UTC

compiling XercesLib.dll under Borland Builder 5

Hi,
	trying to compile under builder 5 I am getting the follwing errors:

[C++ Error] Win32PlatformUtils.cpp(621): E2034 Cannot convert 'void * *'
to 'long *'
[C++ Error] Win32PlatformUtils.cpp(621): E2342 Type mismatch in
parameter 'Destination' (wanted 'long *', got 'void * *')
[C++ Error] Win32PlatformUtils.cpp(621): E2034 Cannot convert 'void *'
to 'long'
[C++ Error] Win32PlatformUtils.cpp(621): E2342 Type mismatch in
parameter 'Exchange' (wanted 'long', got 'void *')
[C++ Error] Win32PlatformUtils.cpp(621): E2034 Cannot convert 'void *'
to 'long'
[C++ Error] Win32PlatformUtils.cpp(621): E2342 Type mismatch in
parameter 'Comperand' (wanted 'long', got 'void *')
[C++ Error] Win32PlatformUtils.cpp(621): E2034 Cannot convert 'long' to
'void *'


relating to c\src\util\Platforms\Win32\Win32PlatformUtils.cpp

//
---------------------------------------------------------------------------
//  Miscellaneous synchronization methods
//
---------------------------------------------------------------------------
void*
XMLPlatformUtils::compareAndSwap(       void**      toFill
                                , const void* const newValue
                                , const void* const toCompare)
	--cut out not relevant stuff

    #else

    //    
    //  Note we have to cast off the constness of some of these because
    //  the system APIs are not C++ aware in all cases.
    //
    return ::InterlockedCompareExchange
    (
        toFill
        , (void*)newValue
        , (void*)toCompare
    );							----line 621
    #endif
}


have looked at the source and can not see how this would work!!

any help is greatly appreciated

-- 
Gareth Reakes, Software Engineer
XML Script/X-Studio Development Team           Office: 44-1865-203192
http://www.xmlscript.org/                      Mobile: 44-7797-503087

Re: compiling XercesLib.dll under Borland Builder 5

Posted by Andy Heninger <he...@us.ibm.com>.
I'm not sure what Borland Builder 5 does, but it seems that
Microsoft changed the argument types for the InterlockedCompareExchange()
function very recently, which has resulted in the same problem
being seen when used with their latest SDK files.

It smells like the same problem.

The ultimate solution is probably to dump the requirement
for compareAndSwap().  It was there to try to speed up DOMString,
but that code was buggy, and no longer exists.  So there's
no need pressing need to keep CompareAndSwap, although there are
a number of uses that would need to be changed before removing it.

For an immediate fix, though, just add casts to the invocation
of ::InterlockedCompareExchange() that match the function prototype
that came with your development environment.

  -- Andy


----- Original Message -----
From: "Gareth Reakes" <ga...@decisionsoft.com>
To: <xe...@xml.apache.org>
Sent: Thursday, March 02, 2000 9:54 AM
Subject: compiling XercesLib.dll under Borland Builder 5


> Hi,
> trying to compile under builder 5 I am getting the follwing errors:
>
> [C++ Error] Win32PlatformUtils.cpp(621): E2034 Cannot convert 'void * *'
> to 'long *'
> [C++ Error] Win32PlatformUtils.cpp(621): E2342 Type mismatch in
> parameter 'Destination' (wanted 'long *', got 'void * *')
> [C++ Error] Win32PlatformUtils.cpp(621): E2034 Cannot convert 'void *'
> to 'long'
> [C++ Error] Win32PlatformUtils.cpp(621): E2342 Type mismatch in
> parameter 'Exchange' (wanted 'long', got 'void *')
> [C++ Error] Win32PlatformUtils.cpp(621): E2034 Cannot convert 'void *'
> to 'long'
> [C++ Error] Win32PlatformUtils.cpp(621): E2342 Type mismatch in
> parameter 'Comperand' (wanted 'long', got 'void *')
> [C++ Error] Win32PlatformUtils.cpp(621): E2034 Cannot convert 'long' to
> 'void *'
>
>
> relating to c\src\util\Platforms\Win32\Win32PlatformUtils.cpp
>
> //
> --------------------------------------------------------------------------
-
> //  Miscellaneous synchronization methods
> //
> --------------------------------------------------------------------------
-
> void*
> XMLPlatformUtils::compareAndSwap(       void**      toFill
>                                 , const void* const newValue
>                                 , const void* const toCompare)
> --cut out not relevant stuff
>
>     #else
>
>     //
>     //  Note we have to cast off the constness of some of these because
>     //  the system APIs are not C++ aware in all cases.
>     //
>     return ::InterlockedCompareExchange
>     (
>         toFill
>         , (void*)newValue
>         , (void*)toCompare
>     ); ----line 621
>     #endif
> }
>
>
> have looked at the source and can not see how this would work!!
>
> any help is greatly appreciated
>
> --
> Gareth Reakes, Software Engineer
> XML Script/X-Studio Development Team           Office: 44-1865-203192
> http://www.xmlscript.org/                      Mobile: 44-7797-503087
>