libosip  4.1.0
osipparser2/internal.h
1 /*
2  The oSIP library implements the Session Initiation Protocol (SIP -rfc3261-)
3  Copyright (C) 2001-2012 Aymeric MOIZARD amoizard@antisip.com
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Lesser General Public
7  License as published by the Free Software Foundation; either
8  version 2.1 of the License, or (at your option) any later version.
9 
10  This library 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 GNU
13  Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public
16  License along with this library; if not, write to the Free Software
17  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19 
20 #ifndef _INTERNALOSIPPARSER_H_
21 #define _INTERNALOSIPPARSER_H_
22 
23 #if defined (HAVE_CONFIG_H)
24 #include <osip-config.h>
25 #endif
26 
27 #if defined(__PALMOS__) && (__PALMOS__ >= 0x06000000)
28 #define HAVE_CTYPE_H 1
29 #define HAVE_STRING_H 1
30 #define HAVE_SYS_TYPES_H 1
31 #define HAVE_TIME_H 1
32 #define HAVE_STDARG_H 1
33 
34 #elif defined(__VXWORKS_OS__) || defined(__rtems__)
35 #define HAVE_STRING_H 1
36 #define HAVE_TIME_H 1
37 #define HAVE_SYS_TIME_H 1
38 #define HAVE_SYS_TYPES_H 1
39 #define HAVE_STDARG_H 1
40 
41 #elif defined _WIN32_WCE
42 
43 #define HAVE_CTYPE_H 1
44 #define HAVE_STRING_H 1
45 #define HAVE_TIME_H 1
46 #define HAVE_STDARG_H 1
47 
48 #define snprintf _snprintf
49 
50 #elif defined(WIN32)
51 
52 #define HAVE_CTYPE_H 1
53 #define HAVE_STRING_H 1
54 #define HAVE_SYS_TYPES_H 1
55 #define HAVE_TIME_H 1
56 #define HAVE_STDARG_H 1
57 
58 #define snprintf _snprintf
59 
60 #if (_MSC_VER >= 1700) && !defined(_USING_V110_SDK71_)
61 #include <winapifamily.h>
62 #endif
63 
64 /* use win32 crypto routines for random number generation */
65 /* only use for vs .net (compiler v. 1300) or greater */
66 #if _MSC_VER >= 1300
67 #define WIN32_USE_CRYPTO 1
68 #if (_MSC_VER >= 1700) && !defined(_USING_V110_SDK71_)
69 #if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
70 #undef WIN32_USE_CRYPTO
71 #elif defined(WINAPI_FAMILY) && WINAPI_FAMILY_ONE_PARTITION( WINAPI_FAMILY, WINAPI_PARTITION_APP )
72 #undef WIN32_USE_CRYPTO
73 #endif
74 #endif
75 #endif
76 
77 #endif
78 
79 #if defined (HAVE_STRING_H)
80 #include <string.h>
81 #elif defined (HAVE_STRINGS_H)
82 #include <strings.h>
83 #else
84 #include <string.h>
85 #endif
86 
87 #include <stdio.h>
88 #include <stdlib.h>
89 
90 #if defined (HAVE_SYS_TYPES_H)
91 #include <sys/types.h>
92 #endif
93 
94 #ifdef HAVE_TIME_H
95 #include <time.h>
96 #endif
97 
98 #if defined (HAVE_SYS_TIME_H)
99 #include <sys/time.h>
100 #endif
101 
102 #if defined(__arc__)
103 #include "includes_api.h"
104 #include "os_cfg_pub.h"
105 #include <posix_time_pub.h>
106 #endif
107 
108 #ifdef __PSOS__
109 #define VA_START(a, f) va_start(a, f)
110 #include "pna.h"
111 #include "stdlib.h"
112 #include "time.h"
113 #define timercmp(tvp, uvp, cmp) \
114 ((tvp)->tv_sec cmp (uvp)->tv_sec || \
115 (tvp)->tv_sec == (uvp)->tv_sec && (tvp)->tv_usec cmp (uvp)->tv_usec)
116 #define snprintf osip_snprintf
117 #ifndef INT_MAX
118 #define INT_MAX 0x7FFFFFFF
119 #endif
120 #endif
121 
122 #endif /* #ifndef _INTERNAL_H_ */