ares_build.h.dist 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. #ifndef __CARES_BUILD_H
  2. #define __CARES_BUILD_H
  3. /* $Id$ */
  4. /* Copyright (C) 2009 by Daniel Stenberg et al
  5. *
  6. * Permission to use, copy, modify, and distribute this software and its
  7. * documentation for any purpose and without fee is hereby granted, provided
  8. * that the above copyright notice appear in all copies and that both that
  9. * copyright notice and this permission notice appear in supporting
  10. * documentation, and that the name of M.I.T. not be used in advertising or
  11. * publicity pertaining to distribution of the software without specific,
  12. * written prior permission. M.I.T. makes no representations about the
  13. * suitability of this software for any purpose. It is provided "as is"
  14. * without express or implied warranty.
  15. */
  16. /* ================================================================ */
  17. /* NOTES FOR CONFIGURE CAPABLE SYSTEMS */
  18. /* ================================================================ */
  19. /*
  20. * NOTE 1:
  21. * -------
  22. *
  23. * See file ares_build.h.in, run configure, and forget that this file
  24. * exists it is only used for non-configure systems.
  25. * But you can keep reading if you want ;-)
  26. *
  27. */
  28. /* ================================================================ */
  29. /* NOTES FOR NON-CONFIGURE SYSTEMS */
  30. /* ================================================================ */
  31. /*
  32. * NOTE 1:
  33. * -------
  34. *
  35. * Nothing in this file is intended to be modified or adjusted by the
  36. * c-ares library user nor by the c-ares library builder.
  37. *
  38. * If you think that something actually needs to be changed, adjusted
  39. * or fixed in this file, then, report it on the c-ares development
  40. * mailing list: http://cool.haxx.se/mailman/listinfo/c-ares/
  41. *
  42. * Try to keep one section per platform, compiler and architecture,
  43. * otherwise, if an existing section is reused for a different one and
  44. * later on the original is adjusted, probably the piggybacking one can
  45. * be adversely changed.
  46. *
  47. * In order to differentiate between platforms/compilers/architectures
  48. * use only compiler built in predefined preprocessor symbols.
  49. *
  50. * This header file shall only export symbols which are 'cares' or 'CARES'
  51. * prefixed, otherwise public name space would be polluted.
  52. *
  53. * NOTE 2:
  54. * -------
  55. *
  56. * Right now you might be staring at file ares_build.h.dist or ares_build.h,
  57. * this is due to the following reason: file ares_build.h.dist is renamed
  58. * to ares_build.h when the c-ares source code distribution archive file is
  59. * created.
  60. *
  61. * File ares_build.h.dist is not included in the distribution archive.
  62. * File ares_build.h is not present in the CVS tree.
  63. *
  64. * The distributed ares_build.h file is only intended to be used on systems
  65. * which can not run the also distributed configure script.
  66. *
  67. * On systems capable of running the configure script, the configure process
  68. * will overwrite the distributed ares_build.h file with one that is suitable
  69. * and specific to the library being configured and built, which is generated
  70. * from the ares_build.h.in template file.
  71. *
  72. * If you check out from CVS on a non-configure platform, you must run the
  73. * appropriate buildconf* script to set up ares_build.h and other local files.
  74. *
  75. */
  76. /* ================================================================ */
  77. /* DEFINITION OF THESE SYMBOLS SHALL NOT TAKE PLACE ANYWHERE ELSE */
  78. /* ================================================================ */
  79. #ifdef CARES_SIZEOF_LONG
  80. # error "CARES_SIZEOF_LONG shall not be defined except in ares_build.h"
  81. Error Compilation_aborted_CARES_SIZEOF_LONG_already_defined
  82. #endif
  83. #ifdef CARES_TYPEOF_ARES_SOCKLEN_T
  84. # error "CARES_TYPEOF_ARES_SOCKLEN_T shall not be defined except in ares_build.h"
  85. Error Compilation_aborted_CARES_TYPEOF_ARES_SOCKLEN_T_already_defined
  86. #endif
  87. #ifdef CARES_SIZEOF_ARES_SOCKLEN_T
  88. # error "CARES_SIZEOF_ARES_SOCKLEN_T shall not be defined except in ares_build.h"
  89. Error Compilation_aborted_CARES_SIZEOF_ARES_SOCKLEN_T_already_defined
  90. #endif
  91. /* ================================================================ */
  92. /* EXTERNAL INTERFACE SETTINGS FOR NON-CONFIGURE SYSTEMS ONLY */
  93. /* ================================================================ */
  94. #if defined(__DJGPP__) || defined(__GO32__)
  95. # define CARES_SIZEOF_LONG 4
  96. # define CARES_TYPEOF_ARES_SOCKLEN_T int
  97. # define CARES_SIZEOF_ARES_SOCKLEN_T 4
  98. #elif defined(__SALFORDC__)
  99. # define CARES_SIZEOF_LONG 4
  100. # define CARES_TYPEOF_ARES_SOCKLEN_T FIXME
  101. # define CARES_SIZEOF_ARES_SOCKLEN_T -1
  102. #elif defined(__BORLANDC__)
  103. # define CARES_SIZEOF_LONG 4
  104. # define CARES_TYPEOF_ARES_SOCKLEN_T FIXME
  105. # define CARES_SIZEOF_ARES_SOCKLEN_T -1
  106. #elif defined(__TURBOC__)
  107. # define CARES_SIZEOF_LONG 4
  108. # define CARES_TYPEOF_ARES_SOCKLEN_T FIXME
  109. # define CARES_SIZEOF_ARES_SOCKLEN_T -1
  110. #elif defined(__WATCOMC__)
  111. # define CARES_SIZEOF_LONG 4
  112. # define CARES_TYPEOF_ARES_SOCKLEN_T FIXME
  113. # define CARES_SIZEOF_ARES_SOCKLEN_T -1
  114. #elif defined(__POCC__)
  115. # define CARES_SIZEOF_LONG 4
  116. # define CARES_TYPEOF_ARES_SOCKLEN_T FIXME
  117. # define CARES_SIZEOF_ARES_SOCKLEN_T -1
  118. #elif defined(__LCC__)
  119. # define CARES_SIZEOF_LONG 4
  120. # define CARES_TYPEOF_ARES_SOCKLEN_T FIXME
  121. # define CARES_SIZEOF_ARES_SOCKLEN_T -1
  122. #elif defined(__SYMBIAN32__)
  123. # define CARES_SIZEOF_LONG 4
  124. # define CARES_TYPEOF_ARES_SOCKLEN_T FIXME
  125. # define CARES_SIZEOF_ARES_SOCKLEN_T -1
  126. #elif defined(__MWERKS__)
  127. # define CARES_SIZEOF_LONG 4
  128. # define CARES_TYPEOF_ARES_SOCKLEN_T FIXME
  129. # define CARES_SIZEOF_ARES_SOCKLEN_T -1
  130. #elif defined(_WIN32_WCE)
  131. # define CARES_SIZEOF_LONG 4
  132. # define CARES_TYPEOF_ARES_SOCKLEN_T FIXME
  133. # define CARES_SIZEOF_ARES_SOCKLEN_T -1
  134. #elif defined(__MINGW32__)
  135. # define CARES_SIZEOF_LONG 4
  136. # define CARES_TYPEOF_ARES_SOCKLEN_T FIXME
  137. # define CARES_SIZEOF_ARES_SOCKLEN_T -1
  138. #elif defined(__VMS)
  139. # define CARES_SIZEOF_LONG 4
  140. # define CARES_TYPEOF_ARES_SOCKLEN_T FIXME
  141. # define CARES_SIZEOF_ARES_SOCKLEN_T -1
  142. #elif defined(__OS400__)
  143. # if defined(__ILEC400__)
  144. # define CARES_SIZEOF_LONG 4
  145. # define CARES_TYPEOF_ARES_SOCKLEN_T FIXME
  146. # define CARES_SIZEOF_ARES_SOCKLEN_T -1
  147. # endif
  148. #elif defined(__MVS__)
  149. # if defined(__IBMC__) || defined(__IBMCPP__)
  150. # if defined(_ILP32)
  151. # define CARES_SIZEOF_LONG 4
  152. # define CARES_TYPEOF_ARES_SOCKLEN_T FIXME
  153. # define CARES_SIZEOF_ARES_SOCKLEN_T -1
  154. # elif defined(_LP64)
  155. # define CARES_SIZEOF_LONG 8
  156. # define CARES_TYPEOF_ARES_SOCKLEN_T FIXME
  157. # define CARES_SIZEOF_ARES_SOCKLEN_T -1
  158. # endif
  159. # endif
  160. #elif defined(__370__)
  161. # if defined(__IBMC__) || defined(__IBMCPP__)
  162. # if defined(_ILP32)
  163. # define CARES_SIZEOF_LONG 4
  164. # define CARES_TYPEOF_ARES_SOCKLEN_T FIXME
  165. # define CARES_SIZEOF_ARES_SOCKLEN_T -1
  166. # elif defined(_LP64)
  167. # define CARES_SIZEOF_LONG 8
  168. # define CARES_TYPEOF_ARES_SOCKLEN_T FIXME
  169. # define CARES_SIZEOF_ARES_SOCKLEN_T -1
  170. # endif
  171. # endif
  172. #elif defined(TPF)
  173. # define CARES_SIZEOF_LONG 8
  174. # define CARES_TYPEOF_ARES_SOCKLEN_T int
  175. # define CARES_SIZEOF_ARES_SOCKLEN_T 4
  176. /* ===================================== */
  177. /* KEEP MSVC THE PENULTIMATE ENTRY */
  178. /* ===================================== */
  179. #elif defined(_MSC_VER)
  180. # define CARES_SIZEOF_LONG 4
  181. # define CARES_TYPEOF_ARES_SOCKLEN_T int
  182. # define CARES_SIZEOF_ARES_SOCKLEN_T 4
  183. /* ===================================== */
  184. /* KEEP GENERIC GCC THE LAST ENTRY */
  185. /* ===================================== */
  186. #elif defined(__GNUC__)
  187. # if defined(__i386__) || defined(__ppc__)
  188. # define CARES_SIZEOF_LONG 4
  189. # define CARES_TYPEOF_ARES_SOCKLEN_T FIXME
  190. # define CARES_SIZEOF_ARES_SOCKLEN_T -1
  191. # elif defined(__x86_64__) || defined(__ppc64__)
  192. # define CARES_SIZEOF_LONG 8
  193. # define CARES_TYPEOF_ARES_SOCKLEN_T FIXME
  194. # define CARES_SIZEOF_ARES_SOCKLEN_T -1
  195. # endif
  196. #else
  197. # error "Unknown non-configure build target!"
  198. Error Compilation_aborted_Unknown_non_configure_build_target
  199. #endif
  200. /* Data type definition of ares_socklen_t. */
  201. #ifdef CARES_TYPEOF_ARES_SOCKLEN_T
  202. typedef CARES_TYPEOF_ARES_SOCKLEN_T ares_socklen_t;
  203. #endif
  204. #endif /* __CARES_BUILD_H */