Defer to (protobuf) defined bswap_XX macros when defined. This resolves compile errors for the QT client on OSX.
[WIP] Fix: OSX QT compile fix: defer to bswap_XX when defined. #9361
pull kallewoof wants to merge 3 commits into bitcoin:master from kallewoof:macosx-qt-build-fix changing 6 files +81 −3-
kallewoof commented at 8:19 AM on December 16, 2016: member
- kallewoof renamed this:
Fix: OSX compile fix: defer to bswap_XX when defined.
Fix: OSX QT compile fix: defer to bswap_XX when defined.
on Dec 16, 2016 - jonasschnelli approved
-
jonasschnelli commented at 9:18 AM on December 16, 2016: contributor
Makes sense. Code Review utACK e62650b5d5fa643daf337031cb4cb914704dd346
-
laanwj commented at 9:40 AM on December 16, 2016: member
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_XXat the top. Don't have a clear preference though. -
kallewoof commented at 9:54 AM on December 16, 2016: member
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 commented at 10:10 AM on December 16, 2016: member
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 commented at 10:13 AM on December 16, 2016: member
That makes a lot of sense. I will dig.
- kallewoof renamed this:
Fix: OSX QT compile fix: defer to bswap_XX when defined.
[WIP] Fix: OSX QT compile fix: defer to bswap_XX when defined.
on Dec 16, 2016 - kallewoof force-pushed on Dec 16, 2016
-
Complain when unknown rpcserialversion is specified 58df13bf3c
-
[qa] Don't set unknown rpcserialversion a544aa0f12
- kallewoof force-pushed on Dec 16, 2016
-
e83b11b792
Uses built-in byte swap if available (Apple) and if bswap_XX is undefined.
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 force-pushed on Dec 16, 2016
-
kallewoof commented at 12:23 PM on December 16, 2016: member
I somehow messed the rebase up. Reopening. Sorry about that.
- kallewoof closed this on Dec 16, 2016
- kallewoof deleted the branch on Dec 16, 2016
- DrahtBot locked this on Sep 8, 2021