[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 138/208: curl_setup: always define WIN32_LEAN_AND_M
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 138/208: curl_setup: always define WIN32_LEAN_AND_MEAN on Windows |
Date: |
Wed, 09 Aug 2017 17:35:35 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to annotated tag gnurl-7.55.0
in repository gnurl.
commit beb08481d01a07a8b10938b1078a5e298b1c2912
Author: Marcel Raad <address@hidden>
AuthorDate: Mon Jul 10 14:56:11 2017 +0200
curl_setup: always define WIN32_LEAN_AND_MEAN on Windows
Make sure to always define WIN32_LEAN_AND_MEAN before including any
Windows headers to avoid pulling in unnecessary headers. This avoids
unnecessary macro clashes and compiler warnings.
Ref: https://github.com/curl/curl/issues/1562
Closes https://github.com/curl/curl/pull/1672
---
include/curl/system.h | 3 ---
lib/curl_setup.h | 14 +++++++++++---
winbuild/MakefileBuild.vc | 2 +-
3 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/include/curl/system.h b/include/curl/system.h
index 973c73ad4..e808580eb 100644
--- a/include/curl/system.h
+++ b/include/curl/system.h
@@ -442,9 +442,6 @@
/* CURL_PULL_WS2TCPIP_H is defined above when inclusion of header file */
/* ws2tcpip.h is required here to properly make type definitions below. */
#ifdef CURL_PULL_WS2TCPIP_H
-# ifndef WIN32_LEAN_AND_MEAN
-# define WIN32_LEAN_AND_MEAN
-# endif
# include <windows.h>
# include <winsock2.h>
# include <ws2tcpip.h>
diff --git a/lib/curl_setup.h b/lib/curl_setup.h
index eb4f038dd..fc597d75d 100644
--- a/lib/curl_setup.h
+++ b/lib/curl_setup.h
@@ -31,6 +31,17 @@
#define WIN32
#endif
+#ifdef WIN32
+/*
+ * Don't include unneeded stuff in Windows headers to avoid compiler
+ * warnings and macro clashes.
+ * Make sure to define this macro before including any Windows headers.
+ */
+# ifndef WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+# endif
+#endif
+
/*
* Include configuration script results or hand-crafted
* configuration file for platforms which lack config tool.
@@ -237,9 +248,6 @@
# if defined(_UNICODE) && !defined(UNICODE)
# define UNICODE
# endif
-# ifndef WIN32_LEAN_AND_MEAN
-# define WIN32_LEAN_AND_MEAN
-# endif
# include <windows.h>
# ifdef HAVE_WINSOCK2_H
# include <winsock2.h>
diff --git a/winbuild/MakefileBuild.vc b/winbuild/MakefileBuild.vc
index eb28efefd..1d8210b3d 100644
--- a/winbuild/MakefileBuild.vc
+++ b/winbuild/MakefileBuild.vc
@@ -60,7 +60,7 @@ CFLAGS = /I. /I../lib /I../include /nologo /W3 /GX
/DWIN32 /YX /FD /c /DBUIL
!ELSE
CC_NODEBUG = $(CC) /O2 /DNDEBUG
CC_DEBUG = $(CC) /Od /D_DEBUG /RTC1 /Z7 /LDd /W3
-CFLAGS = /I. /I ../lib /I../include /nologo /W3 /EHsc /DWIN32 /FD /c
/DBUILDING_LIBCURL /DWIN32_LEAN_AND_MEAN
+CFLAGS = /I. /I ../lib /I../include /nologo /W3 /EHsc /DWIN32 /FD /c
/DBUILDING_LIBCURL
!ENDIF
LFLAGS = /nologo /machine:$(MACHINE)
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnurl] 98/208: configure: remove checks for 5 functions never used, (continued)
- [GNUnet-SVN] [gnurl] 98/208: configure: remove checks for 5 functions never used, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 83/208: test1521: fix out-of-tree builds, broken with 467da3af, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 116/208: appveyor: enable CURL_WERROR on all builds, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 115/208: cmake: add CURL_WERROR for enabling "warning as errors", gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 121/208: CURLOPT_POSTFIELDS.3: explain the 100-continue magic better, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 94/208: travis.yml: use --enable-werror on debug builds, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 61/208: libtest/Makefile: remove unused lib1541 variables, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 174/208: BUGS: improved phrasing about security bugs, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 137/208: strerror: Preserve Windows error code in some functions, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 176/208: tests/server/util: fix curltime mistake from 4dee50b9c80f9, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 138/208: curl_setup: always define WIN32_LEAN_AND_MEAN on Windows,
gnunet <=
- [GNUnet-SVN] [gnurl] 150/208: rtspd: fix GCC warning after MSVC warning fix, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 36/208: tool_wrte_cb: remove check for config == NULL, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 156/208: multi: mention integer overflow risk if using > 500 million sockets, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 191/208: test1010: verify that #1718 is fixed, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 188/208: travis: BUILD_TYPE => T, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 72/208: libtest/make: generate lib1521.c, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 159/208: test1323: verify curlx_tvdiff, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 42/208: http2: fix OOM crash, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 163/208: tool_help: clarify --include is only for response headers, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 206/208: THANKS: 20 new contributors in 7.55.0, gnunet, 2017/08/09