Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
5c5eeba6
Commit
5c5eeba6
authored
Mar 31, 2013
by
Philip Kelley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add git_has_win32_version helper
parent
8cc2f2d8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
8 deletions
+26
-8
src/common.h
+2
-1
src/transports/winhttp.c
+2
-6
src/win32/error.c
+1
-1
src/win32/version.h
+21
-0
No files found.
src/common.h
View file @
5c5eeba6
...
@@ -29,9 +29,10 @@
...
@@ -29,9 +29,10 @@
# include "win32/msvc-compat.h"
# include "win32/msvc-compat.h"
# include "win32/mingw-compat.h"
# include "win32/mingw-compat.h"
# include "win32/error.h"
# include "win32/error.h"
# include "win32/version.h"
# ifdef GIT_THREADS
# ifdef GIT_THREADS
# include "win32/pthread.h"
# include "win32/pthread.h"
#endif
#
endif
#else
#else
...
...
src/transports/winhttp.c
View file @
5c5eeba6
...
@@ -509,11 +509,7 @@ replay:
...
@@ -509,11 +509,7 @@ replay:
/* Check for Windows 7. This workaround is only necessary on
/* Check for Windows 7. This workaround is only necessary on
* Windows Vista and earlier. Windows 7 is version 6.1. */
* Windows Vista and earlier. Windows 7 is version 6.1. */
DWORD
dwVersion
=
GetVersion
();
if
(
!
git_has_win32_version
(
6
,
1
))
{
if
(
LOBYTE
(
LOWORD
(
dwVersion
))
<
6
||
(
LOBYTE
(
LOWORD
(
dwVersion
))
==
6
&&
HIBYTE
(
LOWORD
(
dwVersion
))
<
1
))
{
wchar_t
*
location
;
wchar_t
*
location
;
DWORD
location_length
;
DWORD
location_length
;
int
redirect_cmp
;
int
redirect_cmp
;
...
@@ -991,7 +987,7 @@ static int winhttp_receivepack(
...
@@ -991,7 +987,7 @@ static int winhttp_receivepack(
{
{
/* WinHTTP only supports Transfer-Encoding: chunked
/* WinHTTP only supports Transfer-Encoding: chunked
* on Windows Vista (NT 6.0) and higher. */
* on Windows Vista (NT 6.0) and higher. */
s
->
chunked
=
LOBYTE
(
LOWORD
(
GetVersion
()))
>=
6
;
s
->
chunked
=
git_has_win32_version
(
6
,
0
)
;
if
(
s
->
chunked
)
if
(
s
->
chunked
)
s
->
parent
.
write
=
winhttp_stream_write_chunked
;
s
->
parent
.
write
=
winhttp_stream_write_chunked
;
...
...
src/win32/error.c
View file @
5c5eeba6
...
@@ -45,7 +45,7 @@ char *git_win32_get_error_message(DWORD error_code)
...
@@ -45,7 +45,7 @@ char *git_win32_get_error_message(DWORD error_code)
(
LPWSTR
)
&
lpMsgBuf
,
0
,
NULL
))
{
(
LPWSTR
)
&
lpMsgBuf
,
0
,
NULL
))
{
/* Invalid code point check supported on Vista+ only */
/* Invalid code point check supported on Vista+ only */
if
(
LOBYTE
(
LOWORD
(
GetVersion
()))
>=
6
)
if
(
git_has_win32_version
(
6
,
0
)
)
dwFlags
=
WC_ERR_INVALID_CHARS
;
dwFlags
=
WC_ERR_INVALID_CHARS
;
else
else
dwFlags
=
0
;
dwFlags
=
0
;
...
...
src/win32/version.h
0 → 100644
View file @
5c5eeba6
/*
* Copyright (C) the libgit2 contributors. All rights reserved.
*
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
#ifndef INCLUDE_win32_version_h__
#define INCLUDE_win32_version_h__
#include <windows.h>
GIT_INLINE
(
int
)
git_has_win32_version
(
int
major
,
int
minor
)
{
WORD
wVersion
=
LOWORD
(
GetVersion
());
return
LOBYTE
(
wVersion
)
>
major
||
(
LOBYTE
(
wVersion
)
==
major
&&
HIBYTE
(
wVersion
)
>=
minor
);
}
#endif
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment