52 #if (defined(RT_LINUX) && !defined(RT_ANDROID)) || defined(RT_WIN32) || (defined(RT_MAC) && !defined(RT_IOS))
63 #define _BSD_TIME_T_ long
64 typedef _BSD_TIME_T_ time_t;
66 # define socklen_t int
68 #define EINPROGRESS 36
72 #define RLIMIT_NOFILE 8
76 PTHREAD_MUTEX_TIMED_NP,
77 PTHREAD_MUTEX_RECURSIVE_NP,
78 PTHREAD_MUTEX_ERRORCHECK_NP,
79 PTHREAD_MUTEX_ADAPTIVE_NP
81 , PTHREAD_MUTEX_FAST_NP = PTHREAD_MUTEX_ADAPTIVE_NP
89 #define FIOCLEX _IO('f', 1)
90 #define FIONCLEX _IO('f', 2)
91 #define FIONREAD _IOR('f', 127, int)
92 #define FIONBIO _IOW('f', 126, int)
93 #define FIOASYNC _IOW('f', 125, int)
94 #define FIOSETOWN _IOW('f', 124, int)
95 #define FIOGETOWN _IOR('f', 123, int)
96 #define FIODTYPE _IOR('f', 122, int)
100 #define TCP_NODELAY 0x01
104 #define TCP_MAXSEG 0x02
107 #define TCP_NOPUSH 0x04
108 #define TCP_NOOPT 0x08
111 #define TCP_KEEPALIVE 0x10
115 #define PTHREAD_CREATE_JOINABLE 1
116 #define PTHREAD_CREATE_DETACHED 2
118 #define PTHREAD_INHERIT_SCHED 1
119 #define PTHREAD_EXPLICIT_SCHED 2
121 #define PTHREAD_CANCEL_ENABLE 0x01
122 #define PTHREAD_CANCEL_DISABLE 0x00
123 #define PTHREAD_CANCEL_DEFERRED 0x02
124 #define PTHREAD_CANCEL_ASYNCHRONOUS 0x00
127 #define PTHREAD_SCOPE_SYSTEM 1
128 #define PTHREAD_SCOPE_PROCESS 2
131 #define PTHREAD_PROCESS_SHARED 1
132 #define PTHREAD_PROCESS_PRIVATE 2
147 #define EWOULDBLOCK 35
148 #endif //MachOSupport
152 #ifndef _CRT_SECURE_NO_WARNINGS
153 #define _CRT_SECURE_NO_WARNINGS
156 #ifndef _SCL_SECURE_NO_DEPRECATE
157 #define _SCL_SECURE_NO_DEPRECATE
160 #define _CRT_NONSTDC_NO_WARNINGS
161 #define _CRT_NONSTDC_NO_DEPRECATE
165 #define INADDR_NONE 0xffffffff
170 #if defined (_LIB) || (RT_OS_BUILD_LIB)
171 #define RT_API_EXPORT
173 #if defined (_USRDLL) || (RT_OS_BUILD_DLL)||(_WINDLL)
174 #define RT_API_EXPORT __declspec(dllexport)
176 #define RT_API_EXPORT __declspec(dllimport)
177 #endif // _USRDLL || RT_OS_BUILD_DLL
178 #endif // _LIB || RT_OS_BUILD_LIB
180 #ifdef RT_API_EXPORT_NONEED // for not expect plugin exports api add by oz
182 #define RT_API_EXPORT
185 #elif defined (RT_LINUX)
186 #define RT_API_EXPORT __attribute__((visibility("default")))
188 #define RT_API_EXPORT
192 #if defined (RT_WIN32)
193 #define RT_OS_SEPARATE '\\'
194 #elif defined (RT_UNIX) || defined(RT_MACOS) || defined(RT_IOS)
195 #define RT_OS_SEPARATE '/'
198 #define RT_BIT_ENABLED(dword, bit) (((dword) & (bit)) != 0)
199 #define RT_BIT_DISABLED(dword, bit) (((dword) & (bit)) == 0)
200 #define RT_BIT_CMP_MASK(dword, bit, mask) (((dword) & (bit)) == mask)
201 #define RT_SET_BITS(dword, bits) (dword |= (bits))
202 #define RT_CLR_BITS(dword, bits) (dword &= ~(bits))
214 #if defined (RT_DEBUG)
215 #define RT_ASSERTE _ASSERTE
221 #if defined (RT_DEBUG) && !defined (RT_DISABLE_ASSERTE)
222 #define RT_ASSERTE assert
228 #ifdef RT_DISABLE_ASSERTE
233 #define RT_ASSERTE(expr) \
236 LOG_ERROR(__FILE__ << ":" << __LINE__ << " Assert failed: " << #expr); \
239 #endif // RT_DISABLE_ASSERTE
242 #define RT_ASSERTE(expr)
247 #ifdef RT_DISABLE_ASSERTE
248 #define RT_ASSERTE_RETURN(expr, rv) \
251 LOG_ERROR(__FILE__ << ":" << __LINE__ << " Assert failed: " << #expr); \
256 #define RT_ASSERTE_RETURN_VOID(expr) \
259 LOG_ERROR(__FILE__ << ":" << __LINE__ << " Assert failed: " << #expr); \
264 #define RT_ASSERTE_RETURN(expr, rv) \
266 RT_ASSERTE((expr)); \
268 LOG_ERROR(__FILE__ << ":" << __LINE__ << " Assert failed: " << #expr); \
273 #define RT_ASSERTE_RETURN_VOID(expr) \
275 RT_ASSERTE((expr)); \
277 LOG_ERROR(__FILE__ << ":" << __LINE__ << " Assert failed: " << #expr); \
282 #endif // RT_DISABLE_ASSERTE
286 # if defined (BYTE_ORDER)
287 # if (BYTE_ORDER == LITTLE_ENDIAN)
288 # define RT_LITTLE_ENDIAN 0x0123
289 # define RT_BYTE_ORDER RT_LITTLE_ENDIAN
290 # elif (BYTE_ORDER == BIG_ENDIAN)
291 # define RT_BIG_ENDIAN 0x3210
292 # define RT_BYTE_ORDER RT_BIG_ENDIAN
294 # error: unknown BYTE_ORDER!
296 # elif defined (_BYTE_ORDER)
297 # if (_BYTE_ORDER == _LITTLE_ENDIAN)
298 # define RT_LITTLE_ENDIAN 0x0123
299 # define RT_BYTE_ORDER RT_LITTLE_ENDIAN
300 # elif (_BYTE_ORDER == _BIG_ENDIAN)
301 # define RT_BIG_ENDIAN 0x3210
302 # define RT_BYTE_ORDER RT_BIG_ENDIAN
304 # error: unknown _BYTE_ORDER!
306 # elif defined (__BYTE_ORDER)
307 # if (__BYTE_ORDER == __LITTLE_ENDIAN)
308 # define RT_LITTLE_ENDIAN 0x0123
309 # define RT_BYTE_ORDER RT_LITTLE_ENDIAN
310 # elif (__BYTE_ORDER == __BIG_ENDIAN)
311 # define RT_BIG_ENDIAN 0x3210
312 # define RT_BYTE_ORDER RT_BIG_ENDIAN
314 # error: unknown __BYTE_ORDER!
318 # if defined (i386) || defined (__i386__) || defined (_M_IX86) || \
319 defined (vax) || defined (__alpha) || defined (__LITTLE_ENDIAN__) ||\
320 defined (ARM) || defined (_M_IA64)
322 # define RT_LITTLE_ENDIAN 0x0123
323 # define RT_BYTE_ORDER RT_LITTLE_ENDIAN
326 # define RT_BIG_ENDIAN 0x3210
327 # define RT_BYTE_ORDER RT_BIG_ENDIAN
332 # define RT_LL_PREFIX "I64"
334 #if (defined(RT_LINUX) && !defined(RT_ANDROID)) // linux
335 # define RT_LL_PREFIX "l"
337 # define RT_LL_PREFIX "ll"
342 #if !(defined(_MSC_VER) && (_MSC_VER < 1600))
346 #if !defined(INT_TYPES_DEFINED)
347 #define INT_TYPES_DEFINED
349 typedef unsigned __int64
uint64;
350 typedef __int64
int64;
352 #define INT64_C(x) x ## I64
355 #define UINT64_C(x) x ## UI64
357 #define INT64_F "I64"
358 #else // COMPILER_MSVC
361 #if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS)
363 typedef int64_t
int64;
365 #define INT64_C(x) x ## LL
368 #define UINT64_C(x) x ## ULL
371 #elif defined(__LP64__)
372 typedef unsigned long uint64;
375 #define INT64_C(x) x ## L
378 #define UINT64_C(x) x ## UL
385 #define INT64_C(x) x ## LL
388 #define UINT64_C(x) x ## ULL
392 #endif // COMPILER_MSVC
399 #endif // INT_TYPES_DEFINED
402 #ifndef LONG_MAX // added for linux build
403 #define LONG_MAX (2147483647L)
407 #endif // !RTCDEFINES_H
unsigned short uint16
Definition: defines.h:395
int int32
Definition: defines.h:394
unsigned int uint32
Definition: defines.h:393
long long int64
Definition: defines.h:383
unsigned long long uint64
Definition: defines.h:382
signed char int8
Definition: defines.h:398
unsigned char uint8
Definition: defines.h:397
short int16
Definition: defines.h:396