Skip to content

Commit 690d9a5

Browse files
committed
Merge 'non-win-fixes' into HEAD
2 parents 98518ad + 9122a09 commit 690d9a5

File tree

10 files changed

+47
-11
lines changed

10 files changed

+47
-11
lines changed

Makefile

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,14 +1054,11 @@ else
10541054
REMOTE_CURL_NAMES = $(REMOTE_CURL_PRIMARY) $(REMOTE_CURL_ALIASES)
10551055
PROGRAM_OBJS += http-fetch.o
10561056
PROGRAMS += $(REMOTE_CURL_NAMES)
1057-
curl_check := $(shell (echo 070908; curl-config --vernum | sed -e '/^70[BC]/s/^/0/') 2>/dev/null | sort -r | sed -ne 2p)
1058-
ifeq "$(curl_check)" "070908"
1057+
ifndef NO_CURL_MULTI
10591058
ifndef NO_EXPAT
10601059
PROGRAM_OBJS += http-push.o
10611060
endif
1062-
endif
1063-
curl_check := $(shell (echo 072200; curl-config --vernum | sed -e '/^70[BC]/s/^/0/') 2>/dev/null | sort -r | sed -ne 2p)
1064-
ifeq "$(curl_check)" "072200"
1061+
# Assume that cURL is new enough
10651062
USE_CURL_FOR_IMAP_SEND = YesPlease
10661063
endif
10671064
ifdef USE_CURL_FOR_IMAP_SEND

builtin/gc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ static const char *lock_repo_for_gc(int force, pid_t* ret_pid)
222222
* running.
223223
*/
224224
time(NULL) - st.st_mtime <= 12 * 3600 &&
225-
fscanf(fp, "%"PRIuMAX" %127c", &pid, locking_host) == 2 &&
225+
fscanf(fp, "%"SCNuMAX" %127c", &pid, locking_host) == 2 &&
226226
/* be gentle to concurrent "gc" on remote hosts */
227227
(strcmp(locking_host, my_host) || !kill(pid, 0) || errno == EPERM);
228228
if (fp != NULL)

compat/regex/regcomp.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
1919
02110-1301 USA. */
2020

21+
#include <stdint.h>
22+
2123
static reg_errcode_t re_compile_internal (regex_t *preg, const char * pattern,
2224
size_t length, reg_syntax_t syntax);
2325
static void re_compile_fastmap_iter (regex_t *bufp,
@@ -2577,7 +2579,7 @@ parse_dup_op (bin_tree_t *elem, re_string_t *regexp, re_dfa_t *dfa,
25772579
old_tree = NULL;
25782580

25792581
if (elem->token.type == SUBEXP)
2580-
postorder (elem, mark_opt_subexp, (void *) (long) elem->token.opr.idx);
2582+
postorder (elem, mark_opt_subexp, (void *) (intptr_t) elem->token.opr.idx);
25812583

25822584
tree = create_tree (dfa, elem, NULL, (end == -1 ? OP_DUP_ASTERISK : OP_ALT));
25832585
if (BE (tree == NULL, 0))
@@ -3806,7 +3808,7 @@ create_token_tree (re_dfa_t *dfa, bin_tree_t *left, bin_tree_t *right,
38063808
static reg_errcode_t
38073809
mark_opt_subexp (void *extra, bin_tree_t *node)
38083810
{
3809-
int idx = (int) (long) extra;
3811+
int idx = (int) (intptr_t) extra;
38103812
if (node->token.type == SUBEXP && node->token.opr.idx == idx)
38113813
node->token.opt_subexp = 1;
38123814

configure.ac

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,17 @@ AC_CHECK_LIB([curl], [curl_global_init],
521521
[NO_CURL=],
522522
[NO_CURL=YesPlease])
523523

524+
if test -z "$NO_CURL"; then
525+
526+
AC_CHECK_DECLS([curl_multi_init],
527+
[NO_CURL_MULTI=],
528+
[NO_CURL_MULTI=UnfortunatelyYes],
529+
[[#include <curl/curl.h>]])
530+
531+
GIT_CONF_SUBST([NO_CURL_MULTI])
532+
533+
fi
534+
524535
GIT_UNSTASH_FLAGS($CURLDIR)
525536

526537
GIT_CONF_SUBST([NO_CURL])

git-compat-util.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,10 @@ extern char *gitbasename(char *);
247247
#define PRIuMAX "llu"
248248
#endif
249249

250+
#ifndef SCNuMAX
251+
#define SCNuMAX PRIuMAX
252+
#endif
253+
250254
#ifndef PRIu32
251255
#define PRIu32 "u"
252256
#endif
@@ -519,7 +523,7 @@ extern int git_lstat(const char *, struct stat *);
519523
#endif
520524

521525
#define DEFAULT_PACKED_GIT_LIMIT \
522-
((1024L * 1024L) * (sizeof(void*) >= 8 ? 8192 : 256))
526+
((1024L * 1024L) * (size_t)(sizeof(void*) >= 8 ? 8192 : 256))
523527

524528
#ifdef NO_PREAD
525529
#define pread git_pread

http.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,17 @@ static CURL *get_curl_handle(void)
421421
curl_easy_setopt(result, CURLOPT_PROXY, curl_http_proxy);
422422
#if LIBCURL_VERSION_NUM >= 0x070a07
423423
curl_easy_setopt(result, CURLOPT_PROXYAUTH, CURLAUTH_ANY);
424+
#endif
425+
#if LIBCURL_VERSION_NUM >= 0x071800
426+
if (starts_with(curl_http_proxy, "socks5"))
427+
curl_easy_setopt(result,
428+
CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
429+
else if (starts_with(curl_http_proxy, "socks4a"))
430+
curl_easy_setopt(result,
431+
CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4A);
432+
else if (starts_with(curl_http_proxy, "socks"))
433+
curl_easy_setopt(result,
434+
CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4);
424435
#endif
425436
}
426437

imap-send.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1422,11 +1422,15 @@ static CURL *setup_curl(struct imap_server_conf *srvc)
14221422
curl_easy_setopt(curl, CURLOPT_PORT, server.port);
14231423

14241424
if (server.auth_method) {
1425+
#if LIBCURL_VERSION_NUM < 0x072200
1426+
warning("No LOGIN_OPTIONS support in this cURL version");
1427+
#else
14251428
struct strbuf auth = STRBUF_INIT;
14261429
strbuf_addstr(&auth, "AUTH=");
14271430
strbuf_addstr(&auth, server.auth_method);
14281431
curl_easy_setopt(curl, CURLOPT_LOGIN_OPTIONS, auth.buf);
14291432
strbuf_release(&auth);
1433+
#endif
14301434
}
14311435

14321436
if (!server.use_ssl)

pack-revindex.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ static int pack_revindex_hashsz;
2121

2222
static int pack_revindex_ix(struct packed_git *p)
2323
{
24-
unsigned long ui = (unsigned long)p;
24+
unsigned long ui = (unsigned long)(intptr_t)p;
2525
int i;
2626

2727
ui = ui ^ (ui >> 16); /* defeat structure alignment */

sha1_file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2017,7 +2017,7 @@ static unsigned long pack_entry_hash(struct packed_git *p, off_t base_offset)
20172017
{
20182018
unsigned long hash;
20192019

2020-
hash = (unsigned long)p + (unsigned long)base_offset;
2020+
hash = (unsigned long)(intptr_t)p + (unsigned long)base_offset;
20212021
hash += (hash >> 8) + (hash >> 16);
20222022
return hash % MAX_DELTA_CACHE;
20232023
}

wrap-for-bin.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,11 @@ GIT_TEXTDOMAINDIR='@@BUILD_DIR@@/po/build/locale'
1919
PATH='@@BUILD_DIR@@/bin-wrappers:'"$PATH"
2020
export GIT_EXEC_PATH GITPERLLIB PATH GIT_TEXTDOMAINDIR
2121

22+
if test -n "$TEST_GDB_GIT"
23+
then
24+
exec gdb -args "${GIT_EXEC_PATH}/@@PROG@@" "$@"
25+
echo "Could not run gdb -args ${GIT_EXEC_PATH}/@@PROG@@ $*" >&2
26+
exit 1
27+
fi
28+
2229
exec "${GIT_EXEC_PATH}/@@PROG@@" "$@"

0 commit comments

Comments
 (0)