internal.h 3.0 KB

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