c++: fix 32-bit spaceship failures [PR110185]