thig_platform.h

Go to the documentation of this file.
00001 
00072 #define ROL(x,n) (((x) << ((n) & 0x1F)) | ((x) >> (32-((n) & 0x1F))))
00073 #define ROR(x,n) (((x) >> ((n) & 0x1F)) | ((x) << (32-((n) & 0x1F))))
00074 
00075 #if (0) && defined(__BORLANDC__) && (__BORLANDC__ >= 0x462)
00076 #error "!!!This does not work for some reason!!!"
00077 #include    <stdlib.h>                  /* get prototype for _lrotl() , _lrotr() */
00078 #pragma inline __lrotl__
00079 #pragma inline __lrotr__
00080 #undef  ROL                             
00081 #undef  ROR
00082 #define ROL(x,n)    __lrotl__(x,n)      
00083 #define ROR(x,n)    __lrotr__(x,n)
00084 #endif
00085 
00086 #ifdef _MSC_VER
00087 #include    <stdlib.h>                  /* get prototypes for rotation functions */
00088 #undef  ROL
00089 #undef  ROR
00090 #pragma intrinsic(_lrotl,_lrotr)        
00091 #define ROL(x,n)    _lrotl(x,n)         
00092 #define ROR(x,n)    _lrotr(x,n)
00093 #endif
00094 
00095 #ifndef _M_IX86
00096 #ifdef  __BORLANDC__
00097 #define _M_IX86                 300     
00098 #endif
00099 #endif
00100 
00101 #ifdef _M_IX86
00102 #define     LittleEndian        1       
00103 #define     ALIGN32             0       
00104 #else                                   
00105 #define     LittleEndian        0       
00106 #define     ALIGN32             1       
00107 #endif
00108 
00109 #if LittleEndian
00110 #define     Bswap(x)            (x)     
00111 #define     ADDR_XOR            0       
00112 #else
00113 #define     Bswap(x)            ((ROR(x,8) & 0xFF00FF00) | (ROL(x,8) & 0x00FF00FF))
00114 #define     ADDR_XOR            3       
00115 #endif
00116 
00118 #define _b(x,N) (((BYTE *)&x)[((N) & 3) ^ ADDR_XOR]) /* pick bytes out of a dword */
00119 
00120 #define     b0(x)           _b(x,0)     
00121 #define     b1(x)           _b(x,1)
00122 #define     b2(x)           _b(x,2)
00123 #define     b3(x)           _b(x,3)     

Generated on Thu Oct 23 04:14:38 2008 for Open IMS Core CSCFs by  doxygen 1.5.2