os_auto.h 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. /* pjlib/include/pj/compat/os_auto.h. Generated from os_auto.h.in by configure. */
  2. /*
  3. * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
  4. * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  19. */
  20. #ifndef __PJ_COMPAT_OS_AUTO_H__
  21. #define __PJ_COMPAT_OS_AUTO_H__
  22. /**
  23. * @file os_auto.h
  24. * @brief Describes operating system specifics (automatically detected by
  25. * autoconf)
  26. */
  27. /* Canonical OS name */
  28. #define PJ_OS_NAME "x86_64-unknown-linux-gnu"
  29. /* Legacy macros */
  30. /* #undef PJ_WIN64 */
  31. /* #undef PJ_WIN32 */
  32. /* #undef PJ_WIN32_WINNT */
  33. /* #undef WIN32_LEAN_AND_MEAN */
  34. /* #undef PJ_DARWINOS */
  35. #define PJ_LINUX 1
  36. /* #undef PJ_BSD */
  37. /* #undef PJ_RTEMS */
  38. /* #undef PJ_SUNOS */
  39. /* #undef PJ_ANDROID */
  40. #if defined(PJ_WIN32_WINNT) && !defined(_WIN32_WINNT)
  41. # define _WIN32_WINNT PJ_WIN32_WINNT
  42. #endif
  43. /* Headers availability */
  44. #define PJ_HAS_ARPA_INET_H 1
  45. #define PJ_HAS_ASSERT_H 1
  46. #define PJ_HAS_CTYPE_H 1
  47. #define PJ_HAS_ERRNO_H 1
  48. #define PJ_HAS_FCNTL_H 1
  49. #define PJ_HAS_LIMITS_H 1
  50. #define PJ_HAS_LINUX_SOCKET_H 1
  51. #define PJ_HAS_MALLOC_H 1
  52. #define PJ_HAS_NETDB_H 1
  53. #define PJ_HAS_NETINET_IN_SYSTM_H 1
  54. #define PJ_HAS_NETINET_IN_H 1
  55. #define PJ_HAS_NETINET_IP_H 1
  56. #define PJ_HAS_NETINET_TCP_H 1
  57. #define PJ_HAS_NET_IF_H 1
  58. #define PJ_HAS_IFADDRS_H 1
  59. #define PJ_HAS_INTTYPES_H 1
  60. #define PJ_HAS_SEMAPHORE_H 1
  61. #define PJ_HAS_SETJMP_H 1
  62. #define PJ_HAS_STDARG_H 1
  63. #define PJ_HAS_STDDEF_H 1
  64. #define PJ_HAS_STDIO_H 1
  65. #define PJ_HAS_STDINT_H 1
  66. #define PJ_HAS_STDLIB_H 1
  67. #define PJ_HAS_STRING_H 1
  68. #define PJ_HAS_SYS_IOCTL_H 1
  69. #define PJ_HAS_SYS_SELECT_H 1
  70. #define PJ_HAS_SYS_SOCKET_H 1
  71. #define PJ_HAS_SYS_TIME_H 1
  72. #define PJ_HAS_SYS_TIMEB_H 1
  73. #define PJ_HAS_SYS_TYPES_H 1
  74. /* #undef PJ_HAS_SYS_FILIO_H */
  75. /* #undef PJ_HAS_SYS_SOCKIO_H */
  76. #define PJ_HAS_SYS_UTSNAME_H 1
  77. #define PJ_HAS_TIME_H 1
  78. #define PJ_HAS_UNISTD_H 1
  79. #define PJ_HAS_EXECINFO_H 1
  80. /* #undef PJ_HAS_MSWSOCK_H */
  81. /* #undef PJ_HAS_WINSOCK_H */
  82. /* #undef PJ_HAS_WINSOCK2_H */
  83. /* #undef PJ_HAS_WS2TCPIP_H */
  84. #define PJ_SOCK_HAS_IPV6_V6ONLY 1
  85. #define PJ_SOCK_HAS_INET_ATON 1
  86. #define PJ_SOCK_HAS_INET_PTON 1
  87. #define PJ_SOCK_HAS_INET_NTOP 1
  88. #define PJ_SOCK_HAS_GETADDRINFO 1
  89. #define PJ_SOCK_HAS_SOCKETPAIR 1
  90. /* On these OSes, semaphore feature depends on semaphore.h */
  91. #if defined(PJ_HAS_SEMAPHORE_H) && PJ_HAS_SEMAPHORE_H!=0
  92. # define PJ_HAS_SEMAPHORE 1
  93. #elif defined(PJ_WIN32) && PJ_WIN32!=0
  94. # define PJ_HAS_SEMAPHORE 1
  95. #else
  96. # define PJ_HAS_SEMAPHORE 0
  97. #endif
  98. /* Do we have pthread_mutexattr_settype()? */
  99. /* #undef PJ_HAS_PTHREAD_MUTEXATTR_SETTYPE */
  100. /* Does pthread_mutexattr_t has "recursive" member? */
  101. /* #undef PJ_PTHREAD_MUTEXATTR_T_HAS_RECURSIVE */
  102. /* Set 1 if native sockaddr_in has sin_len member.
  103. * Default: 0
  104. */
  105. /* #undef PJ_SOCKADDR_HAS_LEN */
  106. /* Does the OS have socklen_t? */
  107. #define PJ_HAS_SOCKLEN_T 1
  108. #if !defined(socklen_t) && (!defined(PJ_HAS_SOCKLEN_T) || PJ_HAS_SOCKLEN_T==0)
  109. # define PJ_HAS_SOCKLEN_T 1
  110. typedef int socklen_t;
  111. #endif
  112. /**
  113. * If this macro is set, it tells select I/O Queue that select() needs to
  114. * be given correct value of nfds (i.e. largest fd + 1). This requires
  115. * select ioqueue to re-scan the descriptors on each registration and
  116. * unregistration.
  117. * If this macro is not set, then ioqueue will always give FD_SETSIZE for
  118. * nfds argument when calling select().
  119. *
  120. * Default: 0
  121. */
  122. #define PJ_SELECT_NEEDS_NFDS 0
  123. /* Was Linux epoll support enabled */
  124. /* #undef PJ_HAS_LINUX_EPOLL */
  125. /* Is errno a good way to retrieve OS errors?
  126. */
  127. #define PJ_HAS_ERRNO_VAR 1
  128. /* When this macro is set, getsockopt(SOL_SOCKET, SO_ERROR) will return
  129. * the status of non-blocking connect() operation.
  130. */
  131. #define PJ_HAS_SO_ERROR 1
  132. /* This value specifies the value set in errno by the OS when a non-blocking
  133. * socket recv() can not return immediate daata.
  134. */
  135. #define PJ_BLOCKING_ERROR_VAL EAGAIN
  136. /* This value specifies the value set in errno by the OS when a non-blocking
  137. * socket connect() can not get connected immediately.
  138. */
  139. #define PJ_BLOCKING_CONNECT_ERROR_VAL EINPROGRESS
  140. /* Default threading is enabled, unless it's overridden. */
  141. #ifndef PJ_HAS_THREADS
  142. # define PJ_HAS_THREADS (1)
  143. #endif
  144. /* Do we need high resolution timer? */
  145. #define PJ_HAS_HIGH_RES_TIMER 1
  146. /* Is malloc() available? */
  147. #define PJ_HAS_MALLOC 1
  148. #ifndef PJ_OS_HAS_CHECK_STACK
  149. # define PJ_OS_HAS_CHECK_STACK 0
  150. #endif
  151. /* Is localtime_r() available? */
  152. #define PJ_HAS_LOCALTIME_R 1
  153. /* Unicode? */
  154. #define PJ_NATIVE_STRING_IS_UNICODE 0
  155. /* Pool alignment in bytes */
  156. #define PJ_POOL_ALIGNMENT 8
  157. /* The type of atomic variable value: */
  158. #define PJ_ATOMIC_VALUE_TYPE long
  159. #if defined(PJ_DARWINOS) && PJ_DARWINOS!=0
  160. /* Disable local host resolution in pj_gethostip() (see ticket #1342) */
  161. # define PJ_GETHOSTIP_DISABLE_LOCAL_RESOLUTION 1
  162. /* Use pj_getaddrinfo() (instead of pj_inet_pton()) in
  163. * pj_sockaddr_set_str_addr()
  164. */
  165. # define PJ_SOCKADDR_USE_GETADDRINFO 1
  166. # include "TargetConditionals.h"
  167. # if TARGET_OS_IPHONE
  168. # include "Availability.h"
  169. /* Use CFHost API for pj_getaddrinfo() (see ticket #1246) */
  170. # ifndef PJ_GETADDRINFO_USE_CFHOST
  171. # define PJ_GETADDRINFO_USE_CFHOST 0
  172. # endif
  173. # ifdef __IPHONE_4_0
  174. /* Is multitasking support available? (see ticket #1107) */
  175. # define PJ_IPHONE_OS_HAS_MULTITASKING_SUPPORT 1
  176. /* Activesock TCP background mode support (VoIP socket).
  177. * Disabled by default, VoIP socket deprecated since iOS 9 and
  178. * on iOS16 using VoIP socket causes app getting killed.
  179. */
  180. # define PJ_ACTIVESOCK_TCP_IPHONE_OS_BG 0
  181. # endif
  182. # endif
  183. #endif
  184. /* If 1, use Read/Write mutex emulation for platforms that don't support it */
  185. #define PJ_EMULATE_RWMUTEX 0
  186. /* If 1, pj_thread_create() should enforce the stack size when creating
  187. * threads.
  188. * Default: 0 (let OS decide the thread's stack size).
  189. */
  190. #define PJ_THREAD_SET_STACK_SIZE 0
  191. /* If 1, pj_thread_create() should allocate stack from the pool supplied.
  192. * Default: 0 (let OS allocate memory for thread's stack).
  193. */
  194. #define PJ_THREAD_ALLOCATE_STACK 0
  195. /* SSL socket availability. */
  196. #ifndef PJ_HAS_SSL_SOCK
  197. #define PJ_HAS_SSL_SOCK 1
  198. #endif
  199. #ifndef PJ_SSL_SOCK_IMP
  200. #define PJ_SSL_SOCK_IMP PJ_SSL_SOCK_IMP_OPENSSL
  201. #endif
  202. /* Has pthread_np.h ? */
  203. /* #undef PJ_HAS_PTHREAD_NP_H */
  204. /* Has pthread_setname_np() ? */
  205. #define PJ_HAS_PTHREAD_SETNAME_NP 1
  206. /* Has pthread_set_name_np() ? */
  207. /* #undef PJ_HAS_PTHREAD_SET_NAME_NP */
  208. #endif /* __PJ_COMPAT_OS_AUTO_H__ */