source: trunk/oscam-types.h@ 21

Last change on this file since 21 was 21, checked in by smurzch2, 14 years ago

Rename from MpCS to OSCam

File size: 905 bytes
Line 
1#ifndef _TYPES_H_
2#define _TYPES_H_
3
4#if !defined(OS_AIX)
5typedef unsigned char uchar;
6#endif
7
8//typedef unsigned short ushort;
9
10#if defined(OS_CYGWIN32) || defined(OS_HPUX) || defined(OS_FREEBSD)
11typedef unsigned long ulong;
12#endif
13
14typedef unsigned long long ullong;
15
16#endif // _TYPES_H_
17
18#ifndef NO_ENDIAN_H
19#include <endian.h>
20#include <byteswap.h>
21#endif
22
23#if defined(CS_EMBEDDED) || defined(OS_LINUX)
24
25#ifdef ntohl
26#undef ntohl
27#endif
28#ifdef ntohs
29#undef ntohs
30#endif
31#ifdef htonl
32#undef htonl
33#endif
34#ifdef htons
35#undef htons
36#endif
37
38#if __BYTE_ORDER == __BIG_ENDIAN
39# define ntohl(x) (x)
40# define ntohs(x) (x)
41# define htonl(x) (x)
42# define htons(x) (x)
43#else
44# if __BYTE_ORDER == __LITTLE_ENDIAN
45# define ntohl(x) __bswap_32 (x)
46# define ntohs(x) __bswap_16 (x)
47# define htonl(x) __bswap_32 (x)
48# define htons(x) __bswap_16 (x)
49# endif
50#endif
51
52#endif // CS_EMBEDDED || OS_LINUX
Note: See TracBrowser for help on using the repository browser.