source: trunk/oscam-types.h@ 54

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

Preliminary support for Mac OS X.

Now, it compile, but it will not work with the serial port.
Thanks rorothetroll for this patch

File size: 1001 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) || defined(OS_MACOSX)
11typedef unsigned long ulong;
12#endif
13
14typedef unsigned long long ullong;
15
16#endif // _TYPES_H_
17
18#ifndef NO_ENDIAN_H
19 #ifdef OS_MACOSX
20 #include <machine/endian.h>
21 #else
22 #include <endian.h>
23 #include <byteswap.h>
24 #endif
25#endif
26
27#if defined(CS_EMBEDDED) || defined(OS_LINUX)
28
29#ifdef ntohl
30#undef ntohl
31#endif
32#ifdef ntohs
33#undef ntohs
34#endif
35#ifdef htonl
36#undef htonl
37#endif
38#ifdef htons
39#undef htons
40#endif
41
42#if __BYTE_ORDER == __BIG_ENDIAN
43# define ntohl(x) (x)
44# define ntohs(x) (x)
45# define htonl(x) (x)
46# define htons(x) (x)
47#else
48# if __BYTE_ORDER == __LITTLE_ENDIAN
49# define ntohl(x) __bswap_32 (x)
50# define ntohs(x) __bswap_16 (x)
51# define htonl(x) __bswap_32 (x)
52# define htons(x) __bswap_16 (x)
53# endif
54#endif
55
56#endif // CS_EMBEDDED || OS_LINUX
Note: See TracBrowser for help on using the repository browser.