A const cast does remove the second error (and atomic_cas_ptr does seem like it 
could have used a const argument, since this is the comparison arg, which 
shouldn't be changed).

I still haven't gotten rid of the atomic_xor_uint_nv issue, though, so I can't 
build the OpenSceneGraph on all our platforms.  The code looks like: 

_OPENTHREADS_ATOMIC_INLINE unsigned
Atomic::XOR(unsigned value)
{
#if defined(_OPENTHREADS_ATOMIC_USE_GCC_BUILTINS)
    return __sync_fetch_and_xor(&_value, value);
#elif defined(_OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS)
    return __xor_and_fetch(&_value, value);
#elif defined(_OPENTHREADS_ATOMIC_USE_SUN)
    return atomic_xor_uint_nv(&_value, value);
#elif defined(_OPENTHREADS_ATOMIC_USE_MUTEX)
    ScopedLock<Mutex> lock(_mutex);
    _value ^= value;
    return _value;
#else
    _value ^= value;
    return _value;
#endif
}

The line that complains that atomic_xor_uint_nv() needs a prototype is the one  
inside the condition for _OPENTHREADS_ATOMIC_USE_SUN.

If anyone has an idea of a include I'm supposed to have, or something I'm 
supposed to define, please help.

thanks,
andy


From: [email protected] 
[mailto:[email protected]] On Behalf Of Andy Skinner
Sent: Tuesday, January 06, 2009 1:45 PM
To: OpenSceneGraph Users
Subject: [osg-users] atomic_xor_uint_nv on Solaris

I'm trying to build a recent SVN version, and get errors for 
include/OpenThreads/Atomic:

line 183: Error, badfunccp: The function "atomic_xor_uint_nv" must have a 
prototype.

  I'm not sure about this one.  How is that supposed to be defined?



line 243: Error, badargtype2: Formal argument 2 of type void* in call to 
atomic_cas_ptr(volatile void* void* void*) is being passed const void*const.

Is this one just a const issue?  Should it use a const cast, or is this a sign 
of a problem?

thanks
andy

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to