Skip to content

[paho-mqtt] Fix Windows platform predefined macros#9753

Merged
vicroms merged 2 commits intomicrosoft:masterfrom
JackBoosY:dev/jack/9742
Jan 22, 2020
Merged

[paho-mqtt] Fix Windows platform predefined macros#9753
vicroms merged 2 commits intomicrosoft:masterfrom
JackBoosY:dev/jack/9742

Conversation

@JackBoosY
Copy link
Contributor

According to msdn documentation, fix predefined WIN32 and WIN64.

Related: #9742.

@JackBoosY JackBoosY marked this pull request as ready for review January 19, 2020 06:24
@JackBoosY
Copy link
Contributor Author

Regressions will fixed in #9752.

@JackBoosY JackBoosY requested a review from PhoebeHui January 19, 2020 07:36
@PhoebeHui PhoebeHui added the info:needs-maintainer-attention Lets the current 'on rotation' vcpkg maintainer know they need to look at this. label Jan 21, 2020
@c72578
Copy link
Contributor

c72578 commented Jan 22, 2020

The following code in fix-win-macro.patch introduces redundancy, which is not required:

#if defined(_WIN32) || defined(_WIN64)

The preprocessor macro _WIN32 is defined in both cases (32-bit and 64-bit):

_WIN32 Defined as 1 when the compilation target is 32-bit ARM, 64-bit ARM, x86, or x64. Otherwise, undefined.

So, the following is sufficient (supported by MSVC, GCC, clang):

#if defined(_WIN32)

@JackBoosY
Copy link
Contributor Author

@c72578 Well, I do this because I want to be as consistent as possible with the source code.

@vicroms vicroms merged commit 7371d68 into microsoft:master Jan 22, 2020
@JackBoosY JackBoosY deleted the dev/jack/9742 branch January 23, 2020 02:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

info:needs-maintainer-attention Lets the current 'on rotation' vcpkg maintainer know they need to look at this.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants