[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
  1. kallewoof commented at 8:19 AM on December 16, 2016: member

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

  2. 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
  3. jonasschnelli approved
  4. jonasschnelli commented at 9:18 AM on December 16, 2016: contributor

    Makes sense. Code Review utACK e62650b5d5fa643daf337031cb4cb914704dd346

  5. 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_XX at the top. Don't have a clear preference though.

  6. 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.

  7. 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.

  8. kallewoof commented at 10:13 AM on December 16, 2016: member

    That makes a lot of sense. I will dig.

  9. 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
  10. kallewoof force-pushed on Dec 16, 2016
  11. Complain when unknown rpcserialversion is specified 58df13bf3c
  12. [qa] Don't set unknown rpcserialversion a544aa0f12
  13. kallewoof force-pushed on Dec 16, 2016
  14. 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.
    e83b11b792
  15. kallewoof force-pushed on Dec 16, 2016
  16. kallewoof commented at 12:23 PM on December 16, 2016: member

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

  17. kallewoof closed this on Dec 16, 2016

  18. kallewoof deleted the branch on Dec 16, 2016
  19. DrahtBot locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-14 18:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me