source: abuse/trunk/src/net/include/indian.hpp @ 17

Last change on this file since 17 was 17, checked in by Sam Hocevar, 18 years ago
  • absolute shitloads of 64 bit fixes.
File size: 529 bytes
Line 
1#ifndef lltl
2
3#ifdef __sgi
4#define BIGUNS
5#endif
6
7
8// these macros swap the "endians" of a word to intel form... this should be done for anything sent
9// across the net as the other computer might have a different endianess
10
11#ifdef BIGUNS
12#define lstl(x) (((((uint16_t) (x)))<<8)|((((uint16_t) (x)))>>8))
13#define lltl(x) \
14   ((( ((uint32_t)(x)) )>>24)|((( ((uint32_t)(x)) )&0x00ff0000)>>8)| \
15   ((( ((uint32_t)(x)) )&0x0000ff00)<<8)|(( ((uint32_t)(x)) )<<24))
16#else
17#define lstl(x) (x)
18#define lltl(x) (x)
19
20#endif
21
22#endif
23
24
25
26
27
Note: See TracBrowser for help on using the repository browser.