apr.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667
  1. /* Licensed to the Apache Software Foundation (ASF) under one or more
  2. * contributor license agreements. See the NOTICE file distributed with
  3. * this work for additional information regarding copyright ownership.
  4. * The ASF licenses this file to You under the Apache License, Version 2.0
  5. * (the "License"); you may not use this file except in compliance with
  6. * the License. You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #ifndef APR_H
  17. #define APR_H
  18. /* GENERATED FILE WARNING! DO NOT EDIT apr.h
  19. *
  20. * You must modify apr.hw instead.
  21. *
  22. * And please, make an effort to stub apr.hnw and apr.h.in in the process.
  23. *
  24. * This is the Win32 specific version of apr.h. It is copied from
  25. * apr.hw by the apr.dsp and libapr.dsp projects.
  26. */
  27. /**
  28. * @file apr.h
  29. * @brief APR Platform Definitions
  30. * @remark This is a generated header generated from include/apr.h.in by
  31. * ./configure, or copied from include/apr.hw or include/apr.hnw
  32. * for Win32 or Netware by those build environments, respectively.
  33. */
  34. /* Make sure we have our platform identifier macro defined we ask for later.
  35. */
  36. #if defined(_WIN32) && !defined(WIN32)
  37. #define WIN32 1
  38. #endif
  39. #if defined(WIN32) || defined(DOXYGEN)
  40. /* Ignore most warnings (back down to /W3) for poorly constructed headers
  41. */
  42. #if defined(_MSC_VER) && _MSC_VER >= 1200
  43. #pragma warning(push, 3)
  44. #endif
  45. /* disable or reduce the frequency of...
  46. * C4057: indirection to slightly different base types
  47. * C4075: slight indirection changes (unsigned short* vs short[])
  48. * C4100: unreferenced formal parameter
  49. * C4127: conditional expression is constant
  50. * C4163: '_rotl64' : not available as an intrinsic function
  51. * C4201: nonstandard extension nameless struct/unions
  52. * C4244: int to char/short - precision loss
  53. * C4514: unreferenced inline function removed
  54. */
  55. #if defined(_MSC_VER)
  56. #pragma warning(disable: 4100 4127 4163 4201 4514; once: 4057 4075 4244)
  57. #endif
  58. /* Ignore Microsoft's interpretation of secure development
  59. * and the POSIX string handling API
  60. */
  61. #if defined(_MSC_VER) && _MSC_VER >= 1400
  62. #ifndef _CRT_SECURE_NO_DEPRECATE
  63. #define _CRT_SECURE_NO_DEPRECATE
  64. #endif
  65. #pragma warning(disable: 4996)
  66. #endif
  67. /* Has windows.h already been included? If so, our preferences don't matter,
  68. * but we will still need the winsock things no matter what was included.
  69. * If not, include a restricted set of windows headers to our tastes.
  70. */
  71. #ifndef _WINDOWS_
  72. #ifndef WIN32_LEAN_AND_MEAN
  73. #define WIN32_LEAN_AND_MEAN
  74. #endif
  75. #ifndef _WIN32_WINNT
  76. /* Restrict the server to a subset of Windows XP header files by default
  77. */
  78. #define _WIN32_WINNT 0x0600
  79. #endif
  80. #ifndef NOUSER
  81. #define NOUSER
  82. #endif
  83. #ifndef NOMCX
  84. #define NOMCX
  85. #endif
  86. #ifndef NOIME
  87. #define NOIME
  88. #endif
  89. #include <windows.h>
  90. /*
  91. * Add a _very_few_ declarations missing from the restricted set of headers
  92. * (If this list becomes extensive, re-enable the required headers above!)
  93. * winsock headers were excluded by WIN32_LEAN_AND_MEAN, so include them now
  94. */
  95. #define SW_HIDE 0
  96. #ifndef _WIN32_WCE
  97. #include <winsock2.h>
  98. #include <ws2tcpip.h>
  99. #include <mswsock.h>
  100. #else
  101. #include <winsock.h>
  102. #endif
  103. #endif /* !_WINDOWS_ */
  104. /**
  105. * @defgroup APR Apache Portability Runtime library
  106. * @{
  107. */
  108. /**
  109. * @defgroup apr_platform Platform Definitions
  110. * @{
  111. * @warning
  112. * <strong><em>The actual values of macros and typedefs on this page<br>
  113. * are platform specific and should NOT be relied upon!</em></strong>
  114. */
  115. #define APR_INLINE __inline
  116. #define APR_HAS_INLINE 1
  117. #if !defined(__GNUC__) && !defined(__attribute__)
  118. #define __attribute__(__x)
  119. #endif
  120. #ifndef _WIN32_WCE
  121. #define APR_HAVE_ARPA_INET_H 0
  122. #define APR_HAVE_CONIO_H 1
  123. #define APR_HAVE_CRYPT_H 0
  124. #define APR_HAVE_CTYPE_H 1
  125. #define APR_HAVE_DIRENT_H 0
  126. #define APR_HAVE_ERRNO_H 1
  127. #define APR_HAVE_FCNTL_H 1
  128. #define APR_HAVE_IO_H 1
  129. #define APR_HAVE_LIMITS_H 1
  130. #define APR_HAVE_NETDB_H 0
  131. #define APR_HAVE_NETINET_IN_H 0
  132. #define APR_HAVE_NETINET_SCTP_H 0
  133. #define APR_HAVE_NETINET_SCTP_UIO_H 0
  134. #define APR_HAVE_NETINET_TCP_H 0
  135. #define APR_HAVE_PTHREAD_H 0
  136. #define APR_HAVE_SEMAPHORE_H 0
  137. #define APR_HAVE_SIGNAL_H 1
  138. #define APR_HAVE_STDARG_H 1
  139. #define APR_HAVE_STDINT_H 0
  140. #define APR_HAVE_STDIO_H 1
  141. #define APR_HAVE_STDLIB_H 1
  142. #define APR_HAVE_STRING_H 1
  143. #define APR_HAVE_STRINGS_H 0
  144. #define APR_HAVE_SYS_IOCTL_H 0
  145. #define APR_HAVE_SYS_SENDFILE_H 0
  146. #define APR_HAVE_SYS_SIGNAL_H 0
  147. #define APR_HAVE_SYS_SOCKET_H 0
  148. #define APR_HAVE_SYS_SOCKIO_H 0
  149. #define APR_HAVE_SYS_SYSLIMITS_H 0
  150. #define APR_HAVE_SYS_TIME_H 0
  151. #define APR_HAVE_SYS_TYPES_H 1
  152. #define APR_HAVE_SYS_UIO_H 0
  153. #define APR_HAVE_SYS_UN_H 0
  154. #define APR_HAVE_SYS_WAIT_H 0
  155. #define APR_HAVE_TIME_H 1
  156. #define APR_HAVE_UNISTD_H 0
  157. #define APR_HAVE_STDDEF_H 1
  158. #define APR_HAVE_PROCESS_H 1
  159. #else
  160. #define APR_HAVE_ARPA_INET_H 0
  161. #define APR_HAVE_CONIO_H 0
  162. #define APR_HAVE_CRYPT_H 0
  163. #define APR_HAVE_CTYPE_H 0
  164. #define APR_HAVE_DIRENT_H 0
  165. #define APR_HAVE_ERRNO_H 0
  166. #define APR_HAVE_FCNTL_H 0
  167. #define APR_HAVE_IO_H 0
  168. #define APR_HAVE_LIMITS_H 0
  169. #define APR_HAVE_NETDB_H 0
  170. #define APR_HAVE_NETINET_IN_H 0
  171. #define APR_HAVE_NETINET_SCTP_H 0
  172. #define APR_HAVE_NETINET_SCTP_UIO_H 0
  173. #define APR_HAVE_NETINET_TCP_H 0
  174. #define APR_HAVE_PTHREAD_H 0
  175. #define APR_HAVE_SEMAPHORE_H 0
  176. #define APR_HAVE_SIGNAL_H 0
  177. #define APR_HAVE_STDARG_H 0
  178. #define APR_HAVE_STDINT_H 0
  179. #define APR_HAVE_STDIO_H 1
  180. #define APR_HAVE_STDLIB_H 1
  181. #define APR_HAVE_STRING_H 1
  182. #define APR_HAVE_STRINGS_H 0
  183. #define APR_HAVE_SYS_IOCTL_H 0
  184. #define APR_HAVE_SYS_SENDFILE_H 0
  185. #define APR_HAVE_SYS_SIGNAL_H 0
  186. #define APR_HAVE_SYS_SOCKET_H 0
  187. #define APR_HAVE_SYS_SOCKIO_H 0
  188. #define APR_HAVE_SYS_SYSLIMITS_H 0
  189. #define APR_HAVE_SYS_TIME_H 0
  190. #define APR_HAVE_SYS_TYPES_H 0
  191. #define APR_HAVE_SYS_UIO_H 0
  192. #define APR_HAVE_SYS_UN_H 0
  193. #define APR_HAVE_SYS_WAIT_H 0
  194. #define APR_HAVE_TIME_H 0
  195. #define APR_HAVE_UNISTD_H 0
  196. #define APR_HAVE_STDDEF_H 0
  197. #define APR_HAVE_PROCESS_H 0
  198. #endif
  199. /** @} */
  200. /** @} */
  201. /* We don't include our conditional headers within the doxyblocks
  202. * or the extern "C" namespace
  203. */
  204. #if APR_HAVE_STDLIB_H
  205. #include <stdlib.h>
  206. #endif
  207. #if APR_HAVE_STDIO_H
  208. #include <stdio.h>
  209. #endif
  210. #if APR_HAVE_SYS_TYPES_H
  211. #include <sys/types.h>
  212. #endif
  213. #if APR_HAVE_STDDEF_H
  214. #include <stddef.h>
  215. #endif
  216. #if APR_HAVE_SYS_SOCKET_H
  217. #include <sys/socket.h>
  218. #endif
  219. #if APR_HAVE_STDINT_H
  220. #include <stdint.h>
  221. #endif
  222. #if APR_HAVE_SYS_WAIT_H
  223. #include <sys/wait.h>
  224. #endif
  225. #if APR_HAVE_TIME_H
  226. #include <time.h>
  227. #endif
  228. #if APR_HAVE_PROCESS_H
  229. #include <process.h>
  230. #endif
  231. #ifdef __cplusplus
  232. extern "C" {
  233. #endif
  234. /**
  235. * @addtogroup apr_platform
  236. * @ingroup APR
  237. * @{
  238. */
  239. #define APR_HAVE_SHMEM_MMAP_TMP 0
  240. #define APR_HAVE_SHMEM_MMAP_SHM 0
  241. #define APR_HAVE_SHMEM_MMAP_ZERO 0
  242. #define APR_HAVE_SHMEM_SHMGET_ANON 0
  243. #define APR_HAVE_SHMEM_SHMGET 0
  244. #define APR_HAVE_SHMEM_MMAP_ANON 0
  245. #define APR_HAVE_SHMEM_BEOS 0
  246. #define APR_USE_SHMEM_MMAP_TMP 0
  247. #define APR_USE_SHMEM_MMAP_SHM 0
  248. #define APR_USE_SHMEM_MMAP_ZERO 0
  249. #define APR_USE_SHMEM_SHMGET_ANON 0
  250. #define APR_USE_SHMEM_SHMGET 0
  251. #define APR_USE_SHMEM_MMAP_ANON 0
  252. #define APR_USE_SHMEM_BEOS 0
  253. #define APR_USE_FLOCK_SERIALIZE 0
  254. #define APR_USE_POSIXSEM_SERIALIZE 0
  255. #define APR_USE_SYSVSEM_SERIALIZE 0
  256. #define APR_USE_FCNTL_SERIALIZE 0
  257. #define APR_USE_PROC_PTHREAD_SERIALIZE 0
  258. #define APR_USE_PTHREAD_SERIALIZE 0
  259. #define APR_HAS_FLOCK_SERIALIZE 0
  260. #define APR_HAS_SYSVSEM_SERIALIZE 0
  261. #define APR_HAS_POSIXSEM_SERIALIZE 0
  262. #define APR_HAS_FCNTL_SERIALIZE 0
  263. #define APR_HAS_PROC_PTHREAD_SERIALIZE 0
  264. #define APR_PROCESS_LOCK_IS_GLOBAL 0
  265. #define APR_HAVE_CORKABLE_TCP 0
  266. #define APR_HAVE_GETRLIMIT 0
  267. #define APR_HAVE_ICONV 0
  268. #define APR_HAVE_IN_ADDR 1
  269. #define APR_HAVE_INET_ADDR 1
  270. #define APR_HAVE_INET_NETWORK 0
  271. #define APR_HAVE_IPV6 1
  272. #define APR_HAVE_SOCKADDR_UN 0
  273. #define APR_HAVE_MEMMOVE 1
  274. #define APR_HAVE_SETRLIMIT 0
  275. #define APR_HAVE_SIGACTION 0
  276. #define APR_HAVE_SIGSUSPEND 0
  277. #define APR_HAVE_SIGWAIT 0
  278. #define APR_HAVE_SA_STORAGE 0
  279. #define APR_HAVE_STRCASECMP 0
  280. #define APR_HAVE_STRDUP 1
  281. #define APR_HAVE_STRNCASECMP 0
  282. #define APR_HAVE_STRSTR 1
  283. #define APR_HAVE_MEMCHR 1
  284. #define APR_HAVE_STRUCT_RLIMIT 0
  285. #define APR_HAVE_UNION_SEMUN 0
  286. #define APR_HAVE_SCTP 0
  287. #define APR_HAVE_IOVEC 0
  288. #ifndef _WIN32_WCE
  289. #define APR_HAVE_STRICMP 1
  290. #define APR_HAVE_STRNICMP 1
  291. #else
  292. #define APR_HAVE_STRICMP 0
  293. #define APR_HAVE_STRNICMP 0
  294. #endif
  295. /* APR Feature Macros */
  296. #define APR_HAS_SHARED_MEMORY 1
  297. #define APR_HAS_THREADS 1
  298. #define APR_HAS_MMAP 1
  299. #define APR_HAS_FORK 0
  300. #define APR_HAS_RANDOM 1
  301. #define APR_HAS_OTHER_CHILD 1
  302. #define APR_HAS_DSO 1
  303. #define APR_HAS_SO_ACCEPTFILTER 0
  304. #define APR_HAS_UNICODE_FS 1
  305. #define APR_HAS_PROC_INVOKED 1
  306. #define APR_HAS_OS_UUID 1
  307. #define APR_HAS_TIMEDLOCKS 1
  308. #ifndef _WIN32_WCE
  309. #define APR_HAS_SENDFILE 1
  310. #define APR_HAS_USER 1
  311. #define APR_HAS_LARGE_FILES 1
  312. #define APR_HAS_XTHREAD_FILES 1
  313. #define APR_PROCATTR_USER_SET_REQUIRES_PASSWORD 1
  314. #else
  315. #define APR_HAS_SENDFILE 0
  316. #define APR_HAS_USER 0
  317. #define APR_HAS_LARGE_FILES 0
  318. #define APR_HAS_XTHREAD_FILES 0
  319. #define APR_PROCATTR_USER_SET_REQUIRES_PASSWORD 0
  320. #endif
  321. /* APR sets APR_FILES_AS_SOCKETS to 1 on systems where it is possible
  322. * to poll on files/pipes.
  323. */
  324. #define APR_FILES_AS_SOCKETS 0
  325. /* This macro indicates whether or not EBCDIC is the native character set.
  326. */
  327. #define APR_CHARSET_EBCDIC 0
  328. /* If we have a TCP implementation that can be "corked", what flag
  329. * do we use?
  330. */
  331. #define APR_TCP_NOPUSH_FLAG @apr_tcp_nopush_flag@
  332. /* Is the TCP_NODELAY socket option inherited from listening sockets?
  333. */
  334. #define APR_TCP_NODELAY_INHERITED 1
  335. /* Is the O_NONBLOCK flag inherited from listening sockets?
  336. */
  337. #define APR_O_NONBLOCK_INHERITED 1
  338. /* Typedefs that APR needs. */
  339. typedef unsigned char apr_byte_t;
  340. typedef short apr_int16_t;
  341. typedef unsigned short apr_uint16_t;
  342. typedef int apr_int32_t;
  343. typedef unsigned int apr_uint32_t;
  344. typedef __int64 apr_int64_t;
  345. typedef unsigned __int64 apr_uint64_t;
  346. typedef size_t apr_size_t;
  347. #if APR_HAVE_STDDEF_H
  348. typedef ptrdiff_t apr_ssize_t;
  349. #else
  350. typedef int apr_ssize_t;
  351. #endif
  352. #if APR_HAS_LARGE_FILES
  353. typedef __int64 apr_off_t;
  354. #else
  355. typedef int apr_off_t;
  356. #endif
  357. typedef int apr_socklen_t;
  358. typedef apr_uint64_t apr_ino_t;
  359. #ifdef _WIN64
  360. #define APR_SIZEOF_VOIDP 8
  361. #else
  362. #define APR_SIZEOF_VOIDP 4
  363. #endif
  364. #if APR_SIZEOF_VOIDP == 8
  365. typedef apr_uint64_t apr_uintptr_t;
  366. #else
  367. typedef apr_uint32_t apr_uintptr_t;
  368. #endif
  369. /* Are we big endian? */
  370. /* XXX: Fatal assumption on Alpha platforms */
  371. #define APR_IS_BIGENDIAN 0
  372. /* Mechanisms to properly type numeric literals */
  373. #ifndef __GNUC__
  374. #define APR_INT64_C(val) (val##i64)
  375. #define APR_UINT64_C(val) (val##Ui64)
  376. #else
  377. #define APR_INT64_C(val) (val##LL)
  378. #define APR_UINT64_C(val) (val##ULL)
  379. #endif
  380. #ifdef INT16_MIN
  381. #define APR_INT16_MIN INT16_MIN
  382. #else
  383. #define APR_INT16_MIN (-0x7fff - 1)
  384. #endif
  385. #ifdef INT16_MAX
  386. #define APR_INT16_MAX INT16_MAX
  387. #else
  388. #define APR_INT16_MAX (0x7fff)
  389. #endif
  390. #ifdef UINT16_MAX
  391. #define APR_UINT16_MAX UINT16_MAX
  392. #else
  393. #define APR_UINT16_MAX (0xffff)
  394. #endif
  395. #ifdef INT32_MIN
  396. #define APR_INT32_MIN INT32_MIN
  397. #else
  398. #define APR_INT32_MIN (-0x7fffffff - 1)
  399. #endif
  400. #ifdef INT32_MAX
  401. #define APR_INT32_MAX INT32_MAX
  402. #else
  403. #define APR_INT32_MAX 0x7fffffff
  404. #endif
  405. #ifdef UINT32_MAX
  406. #define APR_UINT32_MAX UINT32_MAX
  407. #else
  408. #define APR_UINT32_MAX (0xffffffffU)
  409. #endif
  410. #ifdef INT64_MIN
  411. #define APR_INT64_MIN INT64_MIN
  412. #else
  413. #define APR_INT64_MIN (APR_INT64_C(-0x7fffffffffffffff) - 1)
  414. #endif
  415. #ifdef INT64_MAX
  416. #define APR_INT64_MAX INT64_MAX
  417. #else
  418. #define APR_INT64_MAX APR_INT64_C(0x7fffffffffffffff)
  419. #endif
  420. #ifdef UINT64_MAX
  421. #define APR_UINT64_MAX UINT64_MAX
  422. #else
  423. #define APR_UINT64_MAX APR_UINT64_C(0xffffffffffffffff)
  424. #endif
  425. #define APR_SIZE_MAX (~((apr_size_t)0))
  426. /* Definitions that APR programs need to work properly. */
  427. /**
  428. * APR public API wrap for C++ compilers.
  429. */
  430. #ifdef __cplusplus
  431. #define APR_BEGIN_DECLS extern "C" {
  432. #define APR_END_DECLS }
  433. #else
  434. #define APR_BEGIN_DECLS
  435. #define APR_END_DECLS
  436. #endif
  437. /**
  438. * Thread callbacks from APR functions must be declared with APR_THREAD_FUNC,
  439. * so that they follow the platform's calling convention.
  440. * <PRE>
  441. *
  442. * void* APR_THREAD_FUNC my_thread_entry_fn(apr_thread_t *thd, void *data);
  443. *
  444. * </PRE>
  445. */
  446. #define APR_THREAD_FUNC __stdcall
  447. #if defined(DOXYGEN) || !defined(WIN32)
  448. /**
  449. * The public APR functions are declared with APR_DECLARE(), so they may
  450. * use the most appropriate calling convention. Public APR functions with
  451. * variable arguments must use APR_DECLARE_NONSTD().
  452. *
  453. * @remark Both the declaration and implementations must use the same macro.
  454. *
  455. * <PRE>
  456. * APR_DECLARE(rettype) apr_func(args)
  457. * </PRE>
  458. * @see APR_DECLARE_NONSTD @see APR_DECLARE_DATA
  459. * @remark Note that when APR compiles the library itself, it passes the
  460. * symbol -DAPR_DECLARE_EXPORT to the compiler on some platforms (e.g. Win32)
  461. * to export public symbols from the dynamic library build.\n
  462. * The user must define the APR_DECLARE_STATIC when compiling to target
  463. * the static APR library on some platforms (e.g. Win32.) The public symbols
  464. * are neither exported nor imported when APR_DECLARE_STATIC is defined.\n
  465. * By default, compiling an application and including the APR public
  466. * headers, without defining APR_DECLARE_STATIC, will prepare the code to be
  467. * linked to the dynamic library.
  468. */
  469. #define APR_DECLARE(type) type
  470. /**
  471. * The public APR functions using variable arguments are declared with
  472. * APR_DECLARE_NONSTD(), as they must follow the C language calling convention.
  473. * @see APR_DECLARE @see APR_DECLARE_DATA
  474. * @remark Both the declaration and implementations must use the same macro.
  475. * <PRE>
  476. *
  477. * APR_DECLARE_NONSTD(rettype) apr_func(args, ...);
  478. *
  479. * </PRE>
  480. */
  481. #define APR_DECLARE_NONSTD(type) type
  482. /**
  483. * The public APR variables are declared with AP_MODULE_DECLARE_DATA.
  484. * This assures the appropriate indirection is invoked at compile time.
  485. * @see APR_DECLARE @see APR_DECLARE_NONSTD
  486. * @remark Note that the declaration and implementations use different forms,
  487. * but both must include the macro.
  488. *
  489. * <PRE>
  490. *
  491. * extern APR_DECLARE_DATA type apr_variable;\n
  492. * APR_DECLARE_DATA type apr_variable = value;
  493. *
  494. * </PRE>
  495. */
  496. #define APR_DECLARE_DATA
  497. #elif defined(APR_DECLARE_STATIC)
  498. #define APR_DECLARE(type) type __stdcall
  499. #define APR_DECLARE_NONSTD(type) type __cdecl
  500. #define APR_DECLARE_DATA
  501. #elif defined(APR_DECLARE_EXPORT)
  502. #define APR_DECLARE(type) __declspec(dllexport) type __stdcall
  503. #define APR_DECLARE_NONSTD(type) __declspec(dllexport) type __cdecl
  504. #define APR_DECLARE_DATA __declspec(dllexport)
  505. #else
  506. #define APR_DECLARE(type) __declspec(dllimport) type __stdcall
  507. #define APR_DECLARE_NONSTD(type) __declspec(dllimport) type __cdecl
  508. #define APR_DECLARE_DATA __declspec(dllimport)
  509. #endif
  510. #ifdef _WIN64
  511. #define APR_SSIZE_T_FMT "I64d"
  512. #define APR_SIZE_T_FMT "I64u"
  513. #else
  514. #define APR_SSIZE_T_FMT "d"
  515. #define APR_SIZE_T_FMT "u"
  516. #endif
  517. #if APR_HAS_LARGE_FILES
  518. #define APR_OFF_T_FMT "I64d"
  519. #else
  520. #define APR_OFF_T_FMT "d"
  521. #endif
  522. #define APR_PID_T_FMT "d"
  523. #define APR_INT64_T_FMT "I64d"
  524. #define APR_UINT64_T_FMT "I64u"
  525. #define APR_UINT64_T_HEX_FMT "I64x"
  526. /* No difference between PROC and GLOBAL mutex */
  527. #define APR_PROC_MUTEX_IS_GLOBAL 1
  528. /* Local machine definition for console and log output. */
  529. #define APR_EOL_STR "\r\n"
  530. typedef int apr_wait_t;
  531. #if APR_HAS_UNICODE_FS
  532. /* An arbitrary size that is digestable. True max is a bit less than 32000 */
  533. #define APR_PATH_MAX 8192
  534. #else /* !APR_HAS_UNICODE_FS */
  535. #define APR_PATH_MAX MAX_PATH
  536. #endif
  537. #define APR_DSOPATH "PATH"
  538. /** @} */
  539. /* Definitions that only Win32 programs need to compile properly. */
  540. /* XXX These simply don't belong here, perhaps in apr_portable.h
  541. * based on some APR_HAVE_PID/GID/UID?
  542. */
  543. #ifndef __GNUC__
  544. typedef int pid_t;
  545. #endif
  546. typedef int uid_t;
  547. typedef int gid_t;
  548. /* Win32 .h ommissions we really need */
  549. #define STDIN_FILENO 0
  550. #define STDOUT_FILENO 1
  551. #define STDERR_FILENO 2
  552. #if APR_HAVE_IPV6
  553. /* Appears in later flavors, not the originals. */
  554. #ifndef in_addr6
  555. #define in6_addr in_addr6
  556. #endif
  557. #ifndef WS2TCPIP_INLINE
  558. #define IN6_IS_ADDR_V4MAPPED(a) \
  559. ( (*(const apr_uint64_t *)(const void *)(&(a)->s6_addr[0]) == 0) \
  560. && (*(const apr_uint32_t *)(const void *)(&(a)->s6_addr[8]) == ntohl(0x0000ffff)))
  561. #endif
  562. #endif /* APR_HAVE_IPV6 */
  563. #ifdef __cplusplus
  564. }
  565. #endif
  566. /* Done with badly written headers, leave 'deprecated CRT' undeprecated
  567. */
  568. #if defined(_MSC_VER) && _MSC_VER >= 1200
  569. #pragma warning(pop)
  570. #if _MSC_VER >= 1400
  571. #pragma warning(disable: 4996)
  572. #endif
  573. #endif
  574. #endif /* WIN32 */
  575. #endif /* APR_H */