Skip to content

Commit ab94cf6

Browse files
committed
Windows: do not redefine _WIN32_WINNT
With MinGW runtime version 4.0 this interferes with the previous definition from sdkddkver.h. Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 72631c9 commit ab94cf6

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

compat/nedmalloc/malloc.c.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,9 @@ MAX_RELEASE_CHECK_RATE default: 4095 unless not HAVE_MMAP
499499
#endif /* WIN32 */
500500
#ifdef WIN32
501501
#define WIN32_LEAN_AND_MEAN
502+
#ifndef _WIN32_WINNT
502503
#define _WIN32_WINNT 0x403
504+
#endif
503505
#include <windows.h>
504506
#define HAVE_MMAP 1
505507
#define HAVE_MORECORE 0

compat/poll/poll.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939

4040
#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
4141
# define WIN32_NATIVE
42-
# if defined (_MSC_VER)
42+
# if defined (_MSC_VER) && !defined(_WIN32_WINNT)
4343
# define _WIN32_WINNT 0x0502
4444
# endif
4545
# include <winsock2.h>

git-compat-util.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@
8686
#define _SGI_SOURCE 1
8787

8888
#if defined(WIN32) && !defined(__CYGWIN__) /* Both MinGW and MSVC */
89-
#define _WIN32_WINNT 0x0502
89+
# if !defined(_WIN32_WINNT)
90+
# define _WIN32_WINNT 0x0502
91+
# endif
9092
#define WIN32_LEAN_AND_MEAN /* stops windows.h including winsock.h */
9193
#include <winsock2.h>
9294
#include <windows.h>

0 commit comments

Comments
 (0)