curl_config.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #pragma once
  2. #include <util/system/platform.h>
  3. #if defined(__ANDROID__) && defined(MAPSMOBI_BUILD)
  4. # include "curl_config-android-maps-mobile.h"
  5. #elif defined(__ANDROID__)
  6. # include "curl_config-android.h"
  7. #elif defined(__IOS__) && defined(MAPSMOBI_BUILD)
  8. # include "curl_config-ios-maps-mobile.h"
  9. #elif defined(__IOS__)
  10. # include "curl_config-ios.h"
  11. #elif defined(__APPLE__)
  12. # include "curl_config-osx.h"
  13. #elif defined(_MSC_VER)
  14. # include "curl_config-win.h"
  15. #else
  16. # include "curl_config-linux.h"
  17. #endif
  18. #if defined(_musl_)
  19. # include "curl_config-musl.h"
  20. #endif
  21. // Do not misrepresent host on Android and iOS.
  22. #undef OS
  23. #define OS "arcadia"
  24. // c-ares resolver is known to be buggy.
  25. //
  26. // There is no way to configure it properly without a JVM on Android,
  27. // because Android lacks traditional resolv.conf.
  28. //
  29. // For standalone Android programs, it is impossible
  30. // to contact ConnectionManager outside the JVM; this breaks c-ares DNS resolution.
  31. // As we can not distinguish builds of Android apps from standalone Android programs.
  32. //
  33. // During mapkit experiments, c-ares was adding about 10ms to each query timespan.
  34. //
  35. //
  36. // On Linux it caches /etc/resolv.conf contents and does not invalidate it properly
  37. #if defined(ARCADIA_CURL_DNS_RESOLVER_ARES)
  38. #define USE_ARES
  39. #elif defined(ARCADIA_CURL_DNS_RESOLVER_MULTITHREADED)
  40. #if defined(USE_ARES)
  41. #undef USE_ARES
  42. #endif
  43. #if defined(__linux__) && !defined(USE_THREADS_POSIX)
  44. #define USE_THREADS_POSIX 1
  45. #elif defined(_MSC_VER) && !defined(USE_THREADS_WIN32)
  46. #define USE_THREADS_WIN32 1
  47. #endif
  48. #elif defined(ARCADIA_CURL_DNS_RESOLVER_SYNCHRONOUS)
  49. // force using synchronous resolver by disabling thread support
  50. #if defined(USE_ARES)
  51. #undef USE_ARES
  52. #endif
  53. #if defined(USE_THREADS_POSIX)
  54. #undef USE_THREADS_POSIX
  55. #endif
  56. #if defined(USE_THREADS_WIN32)
  57. #undef USE_THREADS_WIN32
  58. #endif
  59. #else
  60. #error "No dns resolver is specified or resolver specification is wrong"
  61. #endif