CMake/Utilities/cmcurl/lib/macos.c
Brad King c1f76e6c21 Merge branch 'upstream-curl' into update-curl
* upstream-curl:
  curl 2023-09-13 (6fa1d817)

Upstream significantly refactored `lib/CMakeLists.txt`, so take the
upstream version of everything except the code added by commit
54cb23c657 (curl: Restore installation of OpenSSL DLLs, 2014-11-03,
v3.2.0-rc1~418^2~4).  We will apply our customizations again in a
follow-up commit.
2023-09-22 10:55:37 -04:00

56 lines
1.8 KiB
C

/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
* are also available at https://curl.se/docs/copyright.html.
*
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is
* furnished to do so, under the terms of the COPYING file.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "curl_setup.h"
#ifdef CURL_MACOS_CALL_COPYPROXIES
#include <curl/curl.h>
#include "macos.h"
#include <SystemConfiguration/SCDynamicStoreCopySpecific.h>
CURLcode Curl_macos_init(void)
{
{
/*
* The automagic conversion from IPv4 literals to IPv6 literals only
* works if the SCDynamicStoreCopyProxies system function gets called
* first. As Curl currently doesn't support system-wide HTTP proxies, we
* therefore don't use any value this function might return.
*
* This function is only available on macOS and is not needed for
* IPv4-only builds, hence the conditions for defining
* CURL_MACOS_CALL_COPYPROXIES in curl_setup.h.
*/
CFDictionaryRef dict = SCDynamicStoreCopyProxies(NULL);
if(dict)
CFRelease(dict);
}
return CURLE_OK;
}
#endif