Reversing bitfields on solaris
Samaresh Pradhan
samaresh_pradhan@filemaker.com
Mon Jun 9 23:38:00 GMT 2003
Hi,
I am porting an app from Windows (Visual C++) to Solaris (g++). This
application has encryption and decryption algorithm based on bit position
for given values. But the problem is that bits are arranged differently on
Windows and Solaris. For example, 1 is represented in binary (memory) as
00000001 in Solaris and 10000000 in Windows. Since we have to decrypt old
encrypted keys, we have to get same bit pattern in Solaris as we get in
Windows. In OS X ( C++ compiler of Metrowerks), there is a pragma named
reverse_bitfields on that does the trick. I am looking for similar pragma or
directive in g++. If it is not in g++, then is there any other compiler or
way to do it?
Thanks for your help.
-Samaresh
More information about the Gcc
mailing list