Windows CRTs have a `share.h`. Before this patch when trying to
`#include <share.h>` it, the compiler picked up curl's internal
`lib/share.h` instead. Rename it to avoid this issue.
CRT `share.h` has constants necessary for using safe open CRT functions.
Also rename `lib/share.c` to keep matching the header.
Ref: https://learn.microsoft.com/cpp/c-runtime-library/sharing-constants
Ref:
625f2c1644da58b9617479775badea21f125ce6d #16949 #16991
Cherry-picked from #19643
Closes #19676
curl_rtmp.c \
curl_sasl.c \
curl_sha512_256.c \
+ curl_share.c \
curl_sspi.c \
curl_threads.c \
curl_trc.c \
sendf.c \
setopt.c \
sha256.c \
- share.c \
slist.c \
smb.c \
smtp.c \
curl_setup_once.h \
curl_sha256.h \
curl_sha512_256.h \
+ curl_share.h \
curl_sspi.h \
curl_threads.h \
curl_trc.h \
setup-os400.h \
setup-vms.h \
setup-win32.h \
- share.h \
sigpipe.h \
slist.h \
smb.h \
#include "sendf.h"
#include "hostip.h"
#include "hash.h"
-#include "share.h"
+#include "curl_share.h"
#include "url.h"
#include "multiif.h"
#include "curlx/inet_pton.h"
#include "hash.h"
#include "multiif.h"
#include "select.h"
-#include "share.h"
+#include "curl_share.h"
#include "url.h"
#include "curl_memory.h"
/* The last #include file should be: */
#include "sendf.h"
#include "hostip.h"
#include "hash.h"
-#include "share.h"
+#include "curl_share.h"
#include "url.h"
#include "multiif.h"
#include "curl_threads.h"
#include "conncache.h"
#include "multihandle.h"
#include "rand.h"
-#include "share.h"
+#include "curl_share.h"
#include "strdup.h"
#include "system_win32.h"
#include "curlx/version_win32.h"
#include "conncache.h"
#include "http_negotiate.h"
#include "http_ntlm.h"
-#include "share.h"
+#include "curl_share.h"
#include "sigpipe.h"
#include "connect.h"
#include "select.h"
#include "curlx/warnless.h"
#include "conncache.h"
#include "multihandle.h"
-#include "share.h"
+#include "curl_share.h"
#include "http_proxy.h"
#include "socks.h"
#include "psl.h"
#include "sendf.h"
#include "slist.h"
-#include "share.h"
+#include "curl_share.h"
#include "strcase.h"
#include "curl_fopen.h"
#include "curl_get_line.h"
#include <curl/curl.h>
#include "urldata.h"
#include "connect.h"
-#include "share.h"
+#include "curl_share.h"
#include "psl.h"
#include "vtls/vtls.h"
#include "vtls/vtls_scache.h"
#include "sendf.h"
#include "multiif.h"
#include "url.h"
-#include "share.h"
+#include "curl_share.h"
#include "curlx/base64.h"
#include "connect.h"
#include "strdup.h"
#include "url.h"
#include "getinfo.h"
#include "hostip.h"
-#include "share.h"
+#include "curl_share.h"
#include "strdup.h"
#include "progress.h"
#include "easyif.h"
#include "hostip.h"
#include "hash.h"
#include "rand.h"
-#include "share.h"
+#include "curl_share.h"
#include "url.h"
#include "curlx/inet_ntop.h"
#include "curlx/inet_pton.h"
#include "sendf.h"
#include "hostip.h"
#include "hash.h"
-#include "share.h"
+#include "curl_share.h"
#include "url.h"
/* The last 2 #include files should be in this order */
#include "sendf.h"
#include "hostip.h"
#include "hash.h"
-#include "share.h"
+#include "curl_share.h"
#include "url.h"
#include "curlx/inet_pton.h"
#include "connect.h"
#include "sendf.h"
#include "parsedate.h"
#include "rename.h"
-#include "share.h"
+#include "curl_share.h"
#include "strdup.h"
#include "curlx/strparse.h"
#include "http_aws_sigv4.h"
#include "url.h"
#include "urlapi-int.h"
-#include "share.h"
+#include "curl_share.h"
#include "hostip.h"
#include "dynhds.h"
#include "http.h"
#include "connect.h"
#include "progress.h"
#include "easyif.h"
-#include "share.h"
+#include "curl_share.h"
#include "psl.h"
#include "multiif.h"
#include "multi_ev.h"
#ifdef USE_LIBPSL
#include "psl.h"
-#include "share.h"
+#include "curl_share.h"
/* The last 2 #include files should be in this order */
#include "curl_memory.h"
#include "progress.h"
#include "content_encoding.h"
#include "strcase.h"
-#include "share.h"
+#include "curl_share.h"
#include "vtls/vtls.h"
#include "curlx/warnless.h"
#include "sendf.h"
#include "cookie.h"
#include "strcase.h"
#include "escape.h"
-#include "share.h"
+#include "curl_share.h"
#include "content_encoding.h"
#include "http_digest.h"
#include "http_negotiate.h"
#include "../strcase.h"
#include "../url.h"
#include "../progress.h"
-#include "../share.h"
+#include "../curl_share.h"
#include "../multiif.h"
#include "../curlx/fopen.h"
#include "../curlx/timeval.h"
#include "../strcase.h"
#include "../url.h"
#include "../llist.h"
-#include "../share.h"
+#include "../curl_share.h"
#include "../curl_trc.h"
#include "../curl_sha256.h"
#include "../rand.h"
#include "urldata.h"
#include "connect.h"
-#include "share.h"
+#include "curl_share.h"
#include "memdebug.h" /* LAST include file */
#include "urldata.h"
#include "connect.h"
-#include "share.h"
+#include "curl_share.h"
#include "memdebug.h" /* LAST include file */