deps/unrar/rawint.hpp
// Save integer to memory as big endian.
Save integer to memory as big endian.
Save integer to memory as big endian .
inline void RawPutBE4(uint32 i,byte *mem)
{
#if defined(USE_MEM_BYTESWAP) && defined(_MSC_VER)
  *(uint32*)mem = _byteswap_ulong(i);
#elif defined(USE_MEM_BYTESWAP) && (__GNUC__ > 3) && (__GNUC_MINOR__ > 2)
  *(uint32*)mem = __builtin_bswap32(i);
#else
  mem[0]=byte(i>>24);
  mem[1]=byte(i>>16);
  mem[2]=byte(i>>8);
  mem[3]=byte(i);
#endif
}
inline void RawPutBE4 ( uint32 i , byte * mem ) { #if defined ( USE_MEM_BYTESWAP ) && defined ( _MSC_VER ) * ( uint32 * ) mem = _byteswap_ulong ( i ) ; #elif defined ( USE_MEM_BYTESWAP ) && ( __GNUC__ > 3 ) && ( __GNUC_MINOR__ > 2 ) * ( uint32 * ) mem = __builtin_bswap32 ( i ) ; #else mem [ 0 ] = byte ( i >> 24 ) ; mem [ 1 ] = byte ( i >> 16 ) ; mem [ 2 ] = byte ( i >> 8 ) ; mem [ 3 ] = byte ( i ) ; #endif }
Save integer to memory as big endian.
Save integer to memory as big endian .