Merge slimey's Solaris compatibility (with small mods) (bug #2740)
[asterisk/asterisk.git] / include / solaris-compat / compat.h
1 #ifndef _SOLARIS_COMPAT_H
2 #define _SOLARIS_COMPAT_H
3
4 #define __BEGIN_DECLS
5 #define __END_DECLS
6
7 #ifndef __P
8 #define __P(p) p
9 #endif
10
11 #define LITTLE_ENDIAN 1234
12 #define BIG_ENDIAN 4321
13
14 #define __LITTLE_ENDIAN 1234
15 #define __BIG_ENDIAN 4321
16
17 #ifdef __sparc__
18 #define BYTE_ORDER BIG_ENDIAN
19 #define __BYTE_ORDER BIG_ENDIAN
20 #else
21 #define BYTE_ORDER LITTLE_ENDIAN
22 #define ____BYTE_ORDER BIG_ENDIAN
23 #endif
24
25 #ifndef __BIT_TYPES_DEFINED__
26 #define __BIT_TYPES_DEFINED__
27 typedef unsigned char   u_int8_t;
28 typedef unsigned short  u_int16_t;
29 typedef unsigned int    u_int32_t;
30 #endif
31
32 int setenv(const char *name, const char *value, int overwrite);
33
34 #endif