This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Reversing bitfields on solaris


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]