Fix FreeBSD build by including utilstrencodings.h #13314

pull laanwj wants to merge 1 commits into bitcoin:master from laanwj:2018_05_freebsd_build changing 1 files +1 −0
  1. laanwj commented at 7:12 pm on May 23, 2018: member

    random.cpp needs to explicitly include utilstrencodings.h to get ARRAYLEN. This fixes the FreeBSD build.

    This was broken in 84f41946b9026e8bf7bc44ed848dfb945394b693 (#13236).

  2. laanwj renamed this:
    Fix FreeBSD build by including utilstrencodigs.h
    Fix FreeBSD build by including utilstrencodings.h
    on May 23, 2018
  3. laanwj force-pushed on May 23, 2018
  4. laanwj added the label Linux/Unix on May 23, 2018
  5. Oolanla8888 approved
  6. ken2812221 approved
  7. in src/random.cpp:15 in e8fe9fc361 outdated
    11@@ -12,6 +12,7 @@
    12 #include <wincrypt.h>
    13 #endif
    14 #include <logging.h>  // for LogPrint()
    15+#include <utilstrencodings.h> // for ARRAYLEN
    


    MarcoFalke commented at 7:36 pm on May 23, 2018:
    nit: This is only needed when within the body of the #elif defined(HAVE_SYSCTL_ARND) guard, so you might as well guard the include.

    Empact commented at 9:45 pm on May 23, 2018:
    There’s an existing block at line 36.
  8. MarcoFalke approved
  9. MarcoFalke commented at 7:40 pm on May 23, 2018: member

    utACK e8fe9fc361d1acb9183d7bcd9a7aa0ca53c38af5

    Though, I think the include should be moved into the #ifdef HAVE_SYSCTL_ARND, so that this doesn’t happen again in the future.

    To work around the whole utilstrencodings header, you could include and switch to the cpp11 std::array.

    Feel free to ignore my style nits.

  10. laanwj commented at 7:48 am on May 24, 2018: member

    To work around the whole utilstrencodings header, you could include and switch to the cpp11 std::array.

    I don’t want to ‘work around’ utilstrencodings, I simply want this to build on FreeBSD again :(

    nit: This is only needed when within the body of the #elif defined(HAVE_SYSCTL_ARND) guard, so you might as well guard the include. There’s an existing block at line 36.

    Good idea, will move it into that (edit: done, and it still works).

  11. Fix FreeBSD build by including utilstrencodings.h
    `random.cpp` needs to explicitly include `utilstrencodings.h` to get
    `ARRAYLEN`. This fixes the FreeBSD build.
    
    This was broken in 84f41946b9026e8bf7bc44ed848dfb945394b693.
    c865ee1e73
  12. laanwj force-pushed on May 24, 2018
  13. Empact commented at 10:11 am on May 24, 2018: member
    utACK c865ee1
  14. MarcoFalke commented at 1:03 pm on May 24, 2018: member
    utACK c865ee1
  15. MarcoFalke merged this on May 24, 2018
  16. MarcoFalke closed this on May 24, 2018

  17. MarcoFalke referenced this in commit a9b6957383 on May 24, 2018
  18. PastaPastaPasta referenced this in commit ee9d3a7021 on Jun 17, 2020
  19. PastaPastaPasta referenced this in commit 3d878bdebb on Jun 27, 2020
  20. PastaPastaPasta referenced this in commit 788f16788b on Jun 28, 2020
  21. PastaPastaPasta referenced this in commit 730a00450a on Jun 29, 2020
  22. PastaPastaPasta referenced this in commit 6a71087902 on Jul 1, 2020
  23. random-zebra referenced this in commit 93f43f0f81 on Apr 14, 2021
  24. MarcoFalke 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: 2024-11-22 00:12 UTC

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