extrano84 already found some errors but also 0 will fail and if x is int (instead of unsigned int) all negative numbers will also fail (but so will the original s-macke obfuscation as well).
Of course you should do the right thing, but if you want to break the private of C++ it is much easier to "#define private public" before including the header file.