fspr_private.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  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. /*
  17. * Note:
  18. * This is the windows specific autoconf-like config file
  19. * which unix would create at build time.
  20. */
  21. #ifdef WIN32
  22. #ifndef APR_PRIVATE_H
  23. #define APR_PRIVATE_H
  24. /* Include the public APR symbols, include our idea of the 'right'
  25. * subset of the Windows.h header. This saves us repetition.
  26. */
  27. #include "fspr.h"
  28. /*
  29. * Add a _very_few_ declarations missing from the restricted set of headers
  30. * (If this list becomes extensive, re-enable the required headers above!)
  31. * winsock headers were excluded by WIN32_LEAN_AND_MEAN, so include them now
  32. */
  33. #ifndef SW_HIDE
  34. #define SW_HIDE 0
  35. #endif
  36. /* For the misc.h late-loaded dynamic symbols, we need some obscure types
  37. * Avoid dragging in wtypes.h unless it's absolutely necessary [generally
  38. * not with APR itself, until some GUI-related security is introduced.]
  39. */
  40. #ifndef _WIN32_WCE
  41. #define HAVE_ACLAPI 1
  42. #ifdef __wtypes_h__
  43. #include <accctrl.h>
  44. #else
  45. #define __wtypes_h__
  46. #include <accctrl.h>
  47. #undef __wtypes_h__
  48. #endif
  49. #else
  50. #define HAVE_ACLAPI 0
  51. #endif
  52. #if APR_HAVE_SYS_TYPES_H
  53. #include <sys/types.h>
  54. #endif
  55. #if APR_HAVE_STDDEF_H
  56. #include <stddef.h>
  57. #endif
  58. #include <stdio.h>
  59. #if APR_HAVE_TIME_H
  60. #include <time.h>
  61. #endif
  62. /* Use this section to define all of the HAVE_FOO_H
  63. * that are required to build properly.
  64. */
  65. #define HAVE_LIMITS_H 1
  66. #define HAVE_MALLOC_H 1
  67. #define HAVE_SIGNAL_H 1
  68. /* #define HAVE_STDDEF_H 1 why not? */
  69. #define HAVE_STDLIB_H 1
  70. #define HAVE_STRICMP 1
  71. #define HAVE_STRNICMP 1
  72. #define HAVE_STRDUP 1
  73. #define HAVE_STRSTR 1
  74. #define HAVE_MEMCHR 1
  75. #define SIGHUP 1
  76. /* 2 is used for SIGINT on windows */
  77. #define SIGQUIT 3
  78. /* 4 is used for SIGILL on windows */
  79. #define SIGTRAP 5
  80. #define SIGIOT 6
  81. #define SIGBUS 7
  82. /* 8 is used for SIGFPE on windows */
  83. #define SIGKILL 9
  84. #define SIGUSR1 10
  85. /* 11 is used for SIGSEGV on windows */
  86. #define SIGUSR2 12
  87. #define SIGPIPE 13
  88. #define SIGALRM 14
  89. /* 15 is used for SIGTERM on windows */
  90. #define SIGSTKFLT 16
  91. #define SIGCHLD 17
  92. #define SIGCONT 18
  93. #define SIGSTOP 19
  94. #define SIGTSTP 20
  95. /* 21 is used for SIGBREAK on windows */
  96. /* 22 is used for SIGABRT on windows */
  97. #define SIGTTIN 23
  98. #define SIGTTOU 24
  99. #define SIGURG 25
  100. #define SIGXCPU 26
  101. #define SIGXFSZ 27
  102. #define SIGVTALRM 28
  103. #define SIGPROF 29
  104. #define SIGWINCH 30
  105. #define SIGIO 31
  106. #define __attribute__(__x)
  107. /* APR COMPATABILITY FUNCTIONS
  108. * This section should be used to define functions and
  109. * macros which are need to make Windows features look
  110. * like POSIX features.
  111. */
  112. typedef void (Sigfunc)(int);
  113. #define sleep(t) Sleep((t) * 1000)
  114. #define SIZEOF_SHORT 2
  115. #define SIZEOF_INT 4
  116. #define SIZEOF_LONGLONG 8
  117. #define SIZEOF_CHAR 1
  118. #define SIZEOF_SSIZE_T SIZEOF_INT
  119. unsigned __stdcall SignalHandling(void *);
  120. int thread_ready(void);
  121. #if !APR_HAVE_ERRNO_H
  122. APR_DECLARE_DATA int errno;
  123. #define ENOSPC 1
  124. #endif
  125. #if APR_HAVE_IPV6
  126. #define HAVE_GETADDRINFO 1
  127. #define HAVE_GETNAMEINFO 1
  128. #endif
  129. /* MSVC 7.0 introduced _strtoi64 */
  130. #if _MSC_VER >= 1300 && _INTEGRAL_MAX_BITS >= 64
  131. #define APR_INT64_STRFN _strtoi64
  132. #endif
  133. #if APR_HAS_LARGE_FILES
  134. #ifdef APR_INT64_STRFN
  135. #define APR_OFF_T_STRFN APR_INT64_STRFN
  136. #else
  137. #define APR_OFF_T_STRFN fspr_strtoi64
  138. #endif
  139. #else
  140. #define APR_OFF_T_STRFN strtoi
  141. #endif
  142. /* used to check for DWORD overflow in 64bit compiles */
  143. #define APR_DWORD_MAX 0xFFFFFFFFUL
  144. /*
  145. * Include common private declarations.
  146. */
  147. #include "../fspr_private_common.h"
  148. #endif /*APR_PRIVATE_H*/
  149. #endif /*WIN32*/