libosip  5.3.0
osipparser2/internal.h
1 /*
2  The oSIP library implements the Session Initiation Protocol (SIP -rfc3261-)
3  Copyright (C) 2001-2020 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 #define vsnprintf _vsnprintf
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 HAVE_LOCALTIME 1
59 
60 #if (_MSC_VER < 1900)
61 #define snprintf _snprintf
62 #define vsnprintf _vsnprintf
63 #endif
64 #if (_MSC_VER >= 1700) && !defined(_USING_V110_SDK71_)
65 #include <winapifamily.h>
66 #endif
67 
68 /* use win32 crypto routines for random number generation */
69 /* only use for vs .net (compiler v. 1300) or greater */
70 #if _MSC_VER >= 1300
71 #define WIN32_USE_CRYPTO 1
72 #if (_MSC_VER >= 1700) && !defined(_USING_V110_SDK71_)
73 #if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
74 #undef WIN32_USE_CRYPTO
75 #elif defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_PC_APP)
76 #undef WIN32_USE_CRYPTO
77 #endif
78 #endif
79 #endif
80 
81 #endif
82 
83 #if defined(HAVE_STRING_H)
84 #include <string.h>
85 #elif defined(HAVE_STRINGS_H)
86 #include <strings.h>
87 #else
88 #include <string.h>
89 #endif
90 
91 #include <stdio.h>
92 #include <stdlib.h>
93 
94 #if defined(HAVE_SYS_TYPES_H)
95 #include <sys/types.h>
96 #endif
97 
98 #ifdef HAVE_TIME_H
99 #include <time.h>
100 #endif
101 
102 #if defined(HAVE_SYS_TIME_H)
103 #include <sys/time.h>
104 #endif
105 
106 #if defined(__arc__)
107 #include "includes_api.h"
108 #include "os_cfg_pub.h"
109 #include <posix_time_pub.h>
110 #endif
111 
112 #ifdef __PSOS__
113 #define VA_START(a, f) va_start(a, f)
114 #include "pna.h"
115 #include "stdlib.h"
116 #include "time.h"
117 #define timercmp(tvp, uvp, cmp) ((tvp)->tv_sec cmp(uvp)->tv_sec || (tvp)->tv_sec == (uvp)->tv_sec && (tvp)->tv_usec cmp(uvp)->tv_usec)
118 #define snprintf osip_snprintf
119 #ifndef INT_MAX
120 #define INT_MAX 0x7FFFFFFF
121 #endif
122 #endif
123 
124 #endif /* #ifndef _INTERNAL_H_ */