source: trunk/oscam-types.h @ 5375

Last change on this file since 5375 was 4994, checked in by Admin, 8 years ago

I noticed that monitor encryption is not working on 64bit plattforms due to other sizes of long on this plattform. This patch converts all numeric types like long to portable types like uint32_t. This is not complete yet (only base folder up to r4987, changes thereafter might be incompletely converted). If you encounter problems through this patch please report in forum.

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