Fix check on SSL, MBEDTLS, WINSSL exclusivity #818

Closed
wants to merge 2 commits into
from

Projects

None yet

4 participants

@Jan-E Jan-E Fix check on SSL, MBEDTLS, WINSSL exclusivity
546d645
@mention-bot

By analyzing the blame information on this pull request, we identified @BurningEnlightenment and @vszakats to be potential reviewers

@Jan-E Jan-E referenced this pull request in winlibs/cURL May 19, 2016
Closed

Fix build when upgrading to cURL 7.49.0 #2

@BurningEnlightenment BurningEnlightenment and 2 others commented on an outdated diff May 20, 2016
winbuild/Makefile.vc
@@ -118,6 +114,10 @@ USE_MBEDTLS = true
MBEDTLS = $(WITH_MBEDTLS)
!ENDIF
+!IF ( "$(USE_SSL)"=="true" && "$(USE_WINSSL)"=="true" ) || ( "$(USE_SSL)"=="true" && "$(USE_MBEDTLS)"=="true" ) || ( "$(USE_MBEDTLS)"=="true" && "$(USE_WINSSL)"=="true" )
@BurningEnlightenment
BurningEnlightenment May 20, 2016 edited Contributor

That's a pretty long line, I suggest you wrap it like so:

!IF "$(USE_SSL)"=="true" && "$(USE_WINSSL)"=="true" \
 || "$(USE_SSL)"=="true" && "$(USE_MBEDTLS)"=="true" \
 || "$(USE_MBEDTLS)"=="true" && "$(USE_WINSSL)"=="true"

Otherwise well done! :shipit:

@Jan-E
Jan-E May 20, 2016 Contributor

AFAIK, line wrapping like that does not work in Visual C makefiles

@Jan-E
Jan-E May 20, 2016 Contributor

BTW: the parentheses around the && pairs are once again gone in your suggestion. They really should be there.

@BurningEnlightenment
BurningEnlightenment May 20, 2016 edited Contributor

I haven't checked the docs whether it is supposed to work with preprocessor directives, but it is supported for commands as documented here and I used it in practice without encountering any issues.

BTW: the parentheses around the && pairs are once again gone in your suggestion. They really should be there.

No they are unnecessary, because of a feature called operator precedence which is documented here.

@Jan-E
Jan-E May 20, 2016 Contributor

The parentheses may be unnecessary, but for readability I would still leave them there.

The backslash followed by a line-end was indeed documented for commands I see now, even for VC9. But line-ends and Windows are messy stuff, so why not choose the safe solution? Better safe than sorry.

@BurningEnlightenment
BurningEnlightenment May 20, 2016 Contributor

Both are a matter of taste/code style, so I think a project maintainer like @bagder should decide that.

@Jan-E
Jan-E May 20, 2016 Contributor

Fine with me. Priority is that the building works.

@bagder
bagder May 20, 2016 edited Member

I (although I like to say we so that it doesn't sound so much like a dictatorship), like code that isn't terribly wide as it makes it easier to read so I'm for breaking the line up into several with backslash-continuations.

@Jan-E
Jan-E May 20, 2016 Contributor

With or without the parentheses? If you break it up the logic is clearer, but nevertheless...

@bagder
bagder May 20, 2016 Member

I don't have a strong opinion on that but would leave that to you who're writing this, but my general preference is to add parentheses to help readers to not have to dig out any forgotten precedence rules to understand the order.

@Jan-E
Jan-E May 20, 2016 Contributor

Added this to the PR. Please merge.

@Jan-E Jan-E SSL, MBEDTLS, WINSSL exclusivity: line breaks
26a6480
@bagder bagder closed this in 6bdc609 May 20, 2016
@bagder
Member
bagder commented May 20, 2016

thanks!

@Jan-E
Contributor
Jan-E commented May 20, 2016

BTW: building on VC9, VC11, VC14 * x86, x64 confirm that the patch is OK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment