curl_setup.h: move UWP detection after config-win32.h (revert)#18014
Closed
vszakats wants to merge 1 commit intocurl:masterfrom
Closed
curl_setup.h: move UWP detection after config-win32.h (revert)#18014vszakats wants to merge 1 commit intocurl:masterfrom
config-win32.h (revert)#18014vszakats wants to merge 1 commit intocurl:masterfrom
Conversation
This change wasn't good because `config-win32.h` does rely on the UWP detection result to set `USE_WIN32_CRYPTO` and LDAP macros. While it fixed one issue, it created another. It seems better to revert, and focus on reducing and/or eventually dropping the logic within `config-win32.h` that alters `_WIN32_WINNT`. It may not be necessary anymore with a minimum of VS2008 (soon VS2010). The logic is also absent from cmake builds, without causing issues. Builds affected winbuild/project-file for UWP. These are theoretical builds because neither build method is prepared to target UWP. Reverts 792a61e curl#17980
Member
Author
|
Another way of fixing the UWP/_WIN32_WINNT order conflict: --- a/lib/config-win32.h
+++ b/lib/config-win32.h
@@ -422,17 +422,12 @@
#ifdef CURL_HAS_OPENLDAP_LDAPSDK
#undef USE_WIN32_LDAP
#define HAVE_LDAP_URL_PARSE 1
-#elif !defined(CURL_WINDOWS_UWP) && !defined(UNDER_CE)
+#else
#undef HAVE_LDAP_URL_PARSE
#define HAVE_LDAP_SSL 1
#define USE_WIN32_LDAP 1
#endif
-/* Define to use the Windows crypto library. */
-#ifndef CURL_WINDOWS_UWP
-#define USE_WIN32_CRYPTO
-#endif
-
/* Define to use Unix sockets. */
#ifndef UNDER_CE
#define USE_UNIX_SOCKETS
--- a/lib/curl_setup.h
+++ b/lib/curl_setup.h
@@ -162,6 +162,20 @@
# define CURL_WINDOWS_UWP
# endif
# endif
+
+/* Disable LDAP if not supported by Windows */
+# if defined(USE_WIN32_LDAP) && \
+ (defined(CURL_WINDOWS_UWP) || defined(UNDER_CE))
+# undef USE_WIN32_LDAP
+# undef HAVE_LDAP_SSL
+# endif
+
+/* Always use Windows crypto in non-UWP builds */
+# ifndef CURL_WINDOWS_UWP
+# ifndef USE_WIN32_CRYPTO
+# define USE_WIN32_CRYPTO
+# endif
+# endif
#endif
/* ================================================================ */I like it less because it makes this logic also apply to cmake/autotools builds, |
Member
Sounds reasonable. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change wasn't good because
config-win32.hdoes rely on the UWPdetection result to set
USE_WIN32_CRYPTOand LDAP macros. While itfixed one issue, it created another.
It seems better to revert, and focus on reducing and/or eventually
dropping the logic within
config-win32.hthat alters_WIN32_WINNT.It may not be necessary anymore with a minimum of VS2008 (soon VS2010).
The logic is also absent from cmake builds, without causing issues.
Could affect UWP winbuild/project-file builds. These are theoretical
builds because neither build method is prepared to target UWP.
Reverts 792a61e #17980
Ref: #17980 (comment)