change casting for atomic operations to match osx/smartOS needs