-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmini_defines.h
More file actions
123 lines (102 loc) · 2.93 KB
/
Copy pathmini_defines.h
File metadata and controls
123 lines (102 loc) · 2.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#ifndef MINI_DEFINES_H
#define MINI_DEFINES_H
/* Compilation time configuration */
#if defined(_WIN32_WCE) || defined(_MSC_VER)
//# pragma message("include for wince .............................. ")
# pragma warning (disable: 4290)
# include"compilation_config_w32_wce.h"
#else
//#include "compilation_config.h"
#endif
#include "my_types.h"
#ifndef LIBMINISIP_EXPORTS
# ifdef DLL_EXPORT
# define LIBMUTIL_IMPORTS
# define LIBMNETUTIL_IMPORTS
# define LIBMSIP_IMPORTS
# define LIBMIKEY_IMPORTS
# define LIBMINISIP_EXPORTS
# endif // DLL_EXPORT
#endif // LIBMINISIP_EXPORTS
#define SOUND_CARD_FREQ 16000
#if defined _MSC_VER || defined __MINGW32__
# ifndef WIN32
# define WIN32
# endif
#endif
#ifdef WIN32
//In windows, use direct sound for all, except in windows ce (use then Wave in/out)
# ifdef _WIN32_WCE
# define WAVE_SOUND
# else
# define DSOUND
# endif
# ifndef _WIN32_WINNT
# define _WIN32_WINNT 0x0500
# endif
//warning message: class member needs to have dll-interface to be used by clients of class 'XXX'
# ifndef __MINGW32__
# pragma warning (disable: 4251)
# endif
# ifdef __MINGW32__
# define _WIN32_WINNT 0x0500
# define DSOUND
# endif // !__MINGW32__
#else
# define LINUX
#endif
#include "my_types.h"
//Temporary ... STLPort does not allow addition of errno.h ... but WCEcompat does ...
//So we don't have to repeat this everytime, include errno.h for all files ...
// anyway, it is just an int :)
//Anyway, while compiling for EVC, it will still trigger some warnings ... ignore them, errno exhists for sure.
#ifdef _WIN32_WCE
# ifndef _STLP_NATIVE_ERRNO_H_INCLUDED
# include<wcecompat/errno.h>
# define _STLP_NATIVE_ERRNO_H_INCLUDED
# endif
# include<openssl/err.h>
#else
# include <errno.h>
#endif
// FIXME!!
#ifndef WIN32
#define LINUX
#endif
/* big/little endian conversion */
static inline uint16_t U16_AT( void const * _p )
{
const uint8_t * p = (const uint8_t *)_p;
return ( ((uint16_t)p[0] << 8) | p[1] );
}
static inline uint32_t U32_AT( void const * _p )
{
const uint8_t * p = (const uint8_t *)_p;
return ( ((uint32_t)p[0] << 24) | ((uint32_t)p[1] << 16)
| ((uint32_t)p[2] << 8) | p[3] );
}
static inline uint64_t U64_AT( void const * _p )
{
const uint8_t * p = (const uint8_t *)_p;
return ( ((uint64_t)p[0] << 56) | ((uint64_t)p[1] << 48)
| ((uint64_t)p[2] << 40) | ((uint64_t)p[3] << 32)
| ((uint64_t)p[4] << 24) | ((uint64_t)p[5] << 16)
| ((uint64_t)p[6] << 8) | p[7] );
}
#if defined WORDS_BIGENDIAN
# define hton16(i) ( i )
# define hton32(i) ( i )
# define hton64(i) ( i )
# define ntoh16(i) ( i )
# define ntoh32(i) ( i )
# define ntoh64(i) ( i )
#else
# define hton16(i) U16_AT(&i)
# define hton32(i) U32_AT(&i)
# define hton64(i) U64_AT(&i)
# define ntoh16(i) U16_AT(&i)
# define ntoh32(i) U32_AT(&i)
# define ntoh64(i) U64_AT(&i)
#endif
#define GLOBAL_BANDWIDTH_HACK 1
#endif // MINI_DEFINES_H