curl_config.h 1.7 KB

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