source: abuse/tags/pd/macabuse/src/net/inc/indian.hpp @ 49

Last change on this file since 49 was 49, checked in by Sam Hocevar, 11 years ago
  • Imported original public domain release, for future reference.
File size: 590 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) (((((unsigned short) (x)))<<8)|((((unsigned short) (x)))>>8))
13#define lltl(x) \
14   ((( ((unsigned long)(x)) )>>24)|((( ((unsigned long)(x)) )&0x00ff0000)>>8)| \
15   ((( ((unsigned long)(x)) )&0x0000ff00)<<8)|(( ((unsigned long)(x)) )<<24))
16#else
17#define lstl(x) (x)
18#define lltl(x) (x)
19
20#endif
21
22#define uchar unsigned char
23
24#endif
25
26
27
28
29
Note: See TracBrowser for help on using the repository browser.