Skip to content

Conversation

@kallewoof
Copy link
Contributor

Defer to (protobuf) defined bswap_XX macros when defined. This resolves compile errors for the QT client on OSX.

@kallewoof kallewoof changed the title Fix: OSX compile fix: defer to bswap_XX when defined. Fix: OSX QT compile fix: defer to bswap_XX when defined. Dec 16, 2016
Copy link
Contributor

@jonasschnelli jonasschnelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense.
Code Review utACK e62650b5d5fa643daf337031cb4cb914704dd346

@laanwj
Copy link
Member

laanwj commented Dec 16, 2016

Yes, seems sensible. It's unfortunate that protobuf exports such common names as macros in their public interface.
The other way around would be to put #undef bswap_XX at the top. Don't have a clear preference though.

@kallewoof
Copy link
Contributor Author

Protobuf detects and uses the OS defined OSSwapIntXX macros which might be a nice thing. Other than that yes I'm surprised they are as clumsy as they are considering it's Google.

@laanwj
Copy link
Member

laanwj commented Dec 16, 2016

Protobuf detects and uses the OS defined OSSwapIntXX macros which might be a nice thing

That would be a nice thing if you addded the same detection to our autoconf. The byteswap functions are mainly used in places that don't include (and can't depend on) protobuf.

Now this creates an inconsistency between compilation units that include protobuf and don't include protobuf, in unrelated code.

@kallewoof
Copy link
Contributor Author

kallewoof commented Dec 16, 2016

That makes a lot of sense. I will dig.

@kallewoof kallewoof changed the title Fix: OSX QT compile fix: defer to bswap_XX when defined. [WIP] Fix: OSX QT compile fix: defer to bswap_XX when defined. Dec 16, 2016
…ined.

Defers to pre-defined version if found (e.g. protobuf). For protobuf case, the definitions are identical and thus include order should not affect results.
@kallewoof
Copy link
Contributor Author

I somehow messed the rebase up. Reopening. Sorry about that.

@kallewoof kallewoof closed this Dec 16, 2016
@kallewoof kallewoof deleted the macosx-qt-build-fix branch December 16, 2016 12:30
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants