scripted-diff: Rename `Sock::{RECV,SEND,ERR}` #35588

pull hebasto wants to merge 1 commits into bitcoin:master from hebasto:260623-sunos-macro changing 12 files +50 −50
  1. hebasto commented at 11:48 AM on June 23, 2026: member

    The ERR macro is defined on illumos-based systems in the regset.h header included by the Boost.Test framework, which causes a compilation error:

    [484/792] Building CXX object src/test/CMakeFiles/test_bitcoin.dir/main.cpp.o
    FAILED: [code=1] src/test/CMakeFiles/test_bitcoin.dir/main.cpp.o 
    /usr/bin/g++ -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION -DBOOST_NO_CXX98_FUNCTION_BASE -I/home/runner/work/bitcoin-core-nightly/bitcoin-core-nightly/build/src -I/home/runner/work/bitcoin-core-nightly/bitcoin-core-nightly/src -I/home/runner/work/bitcoin-core-nightly/bitcoin-core-nightly/src/univalue/include -I/home/runner/work/bitcoin-core-nightly/bitcoin-core-nightly/src/minisketch/include -I/home/runner/work/bitcoin-core-nightly/bitcoin-core-nightly/src/secp256k1/include -isystem /usr/gnu/include -pthread -O2 -g -std=c++20 -fno-extended-identifiers -fmacro-prefix-map=/home/runner/work/bitcoin-core-nightly/bitcoin-core-nightly/src=. -fstack-reuse=none -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -Wstack-protector -fstack-protector-all -fcf-protection=full -fstack-clash-protection -Wall -Wextra -Wformat -Wformat-security -Wvla -Wredundant-decls -Wdate-time -Wduplicated-branches -Wduplicated-cond -Wlogical-op -Woverloaded-virtual -Wsuggest-override -Wimplicit-fallthrough -Wunreachable-code -Wbidi-chars=any -Wundef -Wno-unused-parameter -Werror -MD -MT src/test/CMakeFiles/test_bitcoin.dir/main.cpp.o -MF src/test/CMakeFiles/test_bitcoin.dir/main.cpp.o.d -o src/test/CMakeFiles/test_bitcoin.dir/main.cpp.o -c /home/runner/work/bitcoin-core-nightly/bitcoin-core-nightly/src/test/main.cpp 
    In file included from /usr/include/sys/procfs_isa.h:39,
                     from /usr/include/sys/procfs.h:66,
                     from /usr/include/procfs.h:45,
                     from /usr/local/include/boost/test/impl/debug.ipp:85,
                     from /usr/local/include/boost/test/included/unit_test.hpp:20,
                     from /home/runner/work/bitcoin-core-nightly/bitcoin-core-nightly/src/test/main.cpp:10:
    /home/runner/work/bitcoin-core-nightly/bitcoin-core-nightly/src/util/sock.h:162:28: error: expected unqualified-id before numeric constant
      162 |     static constexpr Event ERR = 0b100;
          |                            ^~~
    
    [44](https://github.com/hebasto/bitcoin-core-nightly/actions/runs/28006958536/job/82891036242#step:7:545)
    [ 59%] Building CXX object src/test/CMakeFiles/test_bitcoin.dir/main.cpp.o
    [ 59%] Building CXX object src/test/CMakeFiles/test_bitcoin.dir/addrman_tests.cpp.o
    In file included from /usr/include/sys/procfs_isa.h:39,
                     from /usr/include/sys/procfs.h:66,
                     from /usr/include/procfs.h:45,
                     from /usr/include/boost/test/impl/debug.ipp:85,
                     from /usr/include/boost/test/included/unit_test.hpp:20,
                     from /home/runner/work/bitcoin-core-nightly/bitcoin-core-nightly/src/test/main.cpp:10:
    /home/runner/work/bitcoin-core-nightly/bitcoin-core-nightly/src/util/sock.h:162:28: error: expected unqualified-id before numeric constant
      162 |     static constexpr Event ERR = 0b100;
          |                            ^~~
    
  2. scripted-diff: Rename `Sock::{RECV,SEND,ERR}`
    The `ERR` macro is defined on illumos-based systems in the `regset.h`
    header included by the Boost.Test framework, which causes a compilation
    error.
    
    -BEGIN VERIFY SCRIPT-
    
    ren1() { sed -i "s/\<$1\>/$2/g" $( git grep -l "$1" ./src/util/sock.* ) ; }
    ren1 RECV BITCOIN_RECV
    ren1 SEND BITCOIN_SEND
    ren1 ERR  BITCOIN_ERR
    
    ren2() { sed -i "s/\<$1\>/$2/g" $( git grep -l "$1" ./src/ ) ; }
    ren2 Sock::RECV Sock::BITCOIN_RECV
    ren2 Sock::SEND Sock::BITCOIN_SEND
    ren2 Sock::ERR Sock::BITCOIN_ERR
    
    -END VERIFY SCRIPT-
    e1bc1e2342
  3. hebasto added the label Refactoring on Jun 23, 2026
  4. DrahtBot commented at 11:49 AM on June 23, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/35588.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process. A summary of reviews will appear here.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  5. hebasto commented at 12:33 PM on June 23, 2026: member

    See this PR being tested on the affected systems here: https://github.com/hebasto/bitcoin-core-nightly/pull/276.

Contributors

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-06-24 11:51 UTC

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