blob: 1cf844eebf78c62a8ccc2f5de1006671c6fb21bd [file] [log] [blame]
Benny Prijono8a0ab282008-01-23 20:17:42 +00001/* $Id$ */
2/*
3 * Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19#ifndef __SRTP_CONFIG_H__
20#define __SRTP_CONFIG_H__
21
22#include <pj/types.h>
23
24/* We'll just define CISC if it's x86 family */
Benny Prijono763d2012008-01-24 18:35:00 +000025#if defined (PJ_M_I386) || defined(_i386_) || defined(i_386_) || \
26 defined(_X86_) || defined(x86) || defined(__i386__) || \
27 defined(__i386) || defined(_M_IX86) || defined(__I86__) || \
28 defined (PJ_M_X86_64) || defined(__amd64__) || defined(__amd64) || \
29 defined(__x86_64__) || defined(__x86_64) || \
30 defined(PJ_M_IA64) || defined(__ia64__) || defined(_IA64) || \
31 defined(__IA64__) || defined(_M_IA64)
Benny Prijono8a0ab282008-01-23 20:17:42 +000032# define CPU_CISC 1
Benny Prijono1d481ab2008-01-24 15:27:30 +000033/* # define HAVE_X86 1 use X86 inlined assembly code */
Benny Prijono8a0ab282008-01-23 20:17:42 +000034#else
35# define CPU_RISC 1
36#endif
37
38/* Define to compile in dynamic debugging system. */
39#define ENABLE_DEBUGGING PJ_DEBUG
40
41/* Define to 1 if you have the <arpa/inet.h> header file. */
42#if defined(PJ_HAS_ARPA_INET_H) && PJ_HAS_ARPA_INET_H!=0
43# define HAVE_ARPA_INET_H 1
44#endif
45
46/* Define to 1 if you have the <byteswap.h> header file. */
47/* #undef HAVE_BYTESWAP_H */
48
49/* Define to 1 if you have the `inet_aton' function. */
50#if defined(PJ_SOCK_HAS_INET_PTON) && PJ_SOCK_HAS_INET_PTON
51# define HAVE_INET_ATON 1
52#endif
53
54
55/* Define to 1 if you have the <netinet/in.h> header file. */
56#if defined(PJ_HAS_NETINET_IN_H) && PJ_HAS_NETINET_IN_H!=0
57# define HAVE_NETINET_IN_H 1
58#endif
59
60/* Define to 1 if you have the <stdlib.h> header file. */
61#if defined(PJ_HAS_STDLIB_H) && PJ_HAS_STDLIB_H!=0
62# define HAVE_STDLIB_H 1
63#endif
64
65/* Define to 1 if you have the <string.h> header file. */
66#if defined(PJ_HAS_STRING_H) && PJ_HAS_STRING_H!=0
67# define HAVE_STRING_H 1
68#endif
69
70/* Define to 1 if you have the <sys/socket.h> header file. */
71#if defined(PJ_HAS_SYS_SOCKET_H) && PJ_HAS_SYS_SOCKET_H!=0
72# define HAVE_SYS_SOCKET_H 1
73#endif
74
75/* Define to 1 if you have the <sys/types.h> header file. */
76#if defined(PJ_HAS_SYS_TYPES_H) && PJ_HAS_SYS_TYPES_H!=0
77# define HAVE_SYS_TYPES_H 1
78#endif
79
80/* Define to 1 if you have the <unistd.h> header file. */
81/* Define to 1 if you have the `usleep' function. */
82#if defined(PJ_HAS_UNISTD_H) && PJ_HAS_UNISTD_H!=0
83# define HAVE_UNISTD_H 1
84# define HAVE_USLEEP 1
85#endif
86
87
88/* Define to 1 if you have the <windows.h> header file. */
89#if defined(PJ_WIN32) && PJ_WIN32!=0
90# define HAVE_WINDOWS_H 1
91#endif
92
93/* Define to 1 if you have the <winsock2.h> header file. */
94#if defined(PJ_HAS_WINSOCK2_H) && PJ_HAS_WINSOCK2_H!=0
95# define HAVE_WINSOCK2_H 1
96#endif
97
98#define HAVE_INT16_T 1
99#define HAVE_INT32_T 1
100#define HAVE_INT8_T 1
101#define HAVE_UINT8_T 1
102#define HAVE_UINT16_T 1
103#define HAVE_UINT32_T 1
104#define HAVE_UINT64_T 1
105
106/* Define to 1 if you have the <stdint.h> header file. */
107#if defined(PJ_HAS_STDINT_H) && PJ_HAS_STDINT_H!=0
108# define HAVE_STDINT_H 1
109#else
110 typedef pj_uint8_t uint8_t;
111 typedef pj_uint16_t uint16_t;
112 typedef pj_uint32_t uint32_t;
113 typedef pj_uint64_t uint64_t;
114 typedef pj_int8_t int8_t;
115 typedef pj_int16_t int16_t;
116 typedef pj_int32_t int32_t;
117 typedef pj_int64_t int64_t;
118#endif
119
Benny Prijono763d2012008-01-24 18:35:00 +0000120/* These shouldn't really matter as long as HAVE_UINT64_T is set */
121#define SIZEOF_UNSIGNED_LONG (sizeof(unsigned long))
Benny Prijono8a0ab282008-01-23 20:17:42 +0000122#define SIZEOF_UNSIGNED_LONG_LONG 8
123
124
125#if (_MSC_VER >= 1400) // VC8+
126# ifndef _CRT_SECURE_NO_DEPRECATE
127# define _CRT_SECURE_NO_DEPRECATE
128# endif
129# ifndef _CRT_NONSTDC_NO_DEPRECATE
130# define _CRT_NONSTDC_NO_DEPRECATE
131# endif
132#endif // VC8+
133
134#ifdef _MSC_VER
135# ifndef __cplusplus
136# define inline _inline
137# endif
138
139# pragma warning(disable:4311)
140# pragma warning(disable:4761) // integral mismatch
141# pragma warning(disable:4018) // signed/unsigned mismatch
142# pragma warning(disable:4244) // conversion from int64 to int
143#endif
144
Benny Prijono2c423752008-01-24 10:23:43 +0000145/* clock() */
146#if defined(PJ_WIN32_WINCE) && PJ_WIN32_WINCE!=0
147 /* clock() causes unresolved symbol on linking */
148# define _CLOCK_T_DEFINED
149# define CLOCKS_PER_SEC 1000
150# define clock_t unsigned
151
152 #include <windows.h>
153 static clock_t clock(void)
154 {
155 return GetTickCount();
156 }
157#endif
158
Benny Prijono8a0ab282008-01-23 20:17:42 +0000159
160/* Path to random device */
161/* #define DEV_URANDOM "/dev/urandom" */
162
Benny Prijono1d481ab2008-01-24 15:27:30 +0000163/* Only with PJSIP:
164 * Try to open PJ_DEV_URANDOM if present
165 */
166#if defined(PJ_HAS_FCNTL_H) && defined(PJ_HAS_UNISTD_H)
167# define PJ_DEV_URANDOM "/dev/urandom"
168#endif
169
Benny Prijono8a0ab282008-01-23 20:17:42 +0000170/* We have overridden libsrtp error mechanism, so these are not used. */
171/* #undef ERR_REPORTING_FILE */
172/* #undef ERR_REPORTING_STDOUT */
173/* #undef USE_ERR_REPORTING_FILE */
174/* #undef USE_SYSLOG */
175/* #undef HAVE_SYSLOG_H */
176
177
178/* Define this to use ISMAcryp code. */
179/* #undef GENERIC_AESICM */
180
181/* Define to 1 if you have the <inttypes.h> header file. */
182/* #undef HAVE_INTTYPES_H */
183
184/* Define to 1 if you have the `socket' function. */
185/* #undef HAVE_SOCKET */
186
187/* Define to 1 if you have the `socket' library (-lsocket). */
188/* #undef HAVE_LIBSOCKET */
189
190/* Define to 1 if you have the <machine/types.h> header file. */
191/* #undef HAVE_MACHINE_TYPES_H */
192
193
194/* Define to 1 if you have the <strings.h> header file. */
195//#define HAVE_STRINGS_H 1
196
197/* Define to 1 if you have the <sys/int_types.h> header file. */
198/* #undef HAVE_SYS_INT_TYPES_H */
199
200/* Define to use GDOI. */
201/* #undef SRTP_GDOI */
202
203/* Define to compile for kernel contexts. */
204/* #undef SRTP_KERNEL */
205
206/* Define to compile for Linux kernel context. */
207/* #undef SRTP_KERNEL_LINUX */
208
209/* Define to 1 if you have the ANSI C header files. */
210//#define STDC_HEADERS 1
211
212/* Endianness would have been set by pjlib. */
213/* #undef WORDS_BIGENDIAN */
214
215/* Define to empty if `const' does not conform to ANSI C. */
216/* #undef const */
217
218/* Define to `unsigned' if <sys/types.h> does not define. */
219/* #undef size_t */
220
221
222#endif /* __SRTP_CONFIG_H__ */
223