refactor: prefix external config macros with SECP256K1_#1833
Open
w0xlt wants to merge 6 commits intobitcoin-core:masterfrom
Open
refactor: prefix external config macros with SECP256K1_#1833w0xlt wants to merge 6 commits intobitcoin-core:masterfrom
SECP256K1_#1833w0xlt wants to merge 6 commits intobitcoin-core:masterfrom
Conversation
Rename all ENABLE_MODULE_{ECDH,RECOVERY,EXTRAKEYS,SCHNORRSIG,MUSIG,
ELLSWIFT} preprocessor macros to SECP256K1_ENABLE_MODULE_* to avoid
namespace collisions and ensure consistency with the library's naming
convention.
Rename the standalone VERIFY preprocessor config macro to SECP256K1_VERIFY. This does not affect VERIFY_CHECK or other compound macros which will be addressed separately. Updates build definitions in Makefile.am, src/CMakeLists.txt, and CI configuration.
Rename USE_ASM_X86_64, USE_EXTERNAL_ASM, USE_FORCE_WIDEMUL_INT128, USE_FORCE_WIDEMUL_INT128_STRUCT, USE_FORCE_WIDEMUL_INT64, and USE_EXTERNAL_DEFAULT_CALLBACKS to their SECP256K1_ prefixed equivalents. Updates configure.ac and CMakeLists.txt build definitions alongside all source file references.
…P256K1_ Rename the externally configurable ecmult parameter macros to use the SECP256K1_ prefix, preventing namespace collisions when the library is used in header-only mode.
Rename the EXHAUSTIVE_TEST_ORDER config macro used in exhaustive test builds to SECP256K1_EXHAUSTIVE_TEST_ORDER to follow the library's naming convention.
…PORTS_CONCURRENCY with SECP256K1_ Rename the remaining external config macros to use the SECP256K1_ prefix: - DETERMINISTIC -> SECP256K1_DETERMINISTIC - COVERAGE -> SECP256K1_COVERAGE - VALGRIND -> SECP256K1_VALGRIND - DEBUG_CONFIG -> SECP256K1_DEBUG_CONFIG - SUPPORTS_CONCURRENCY -> SECP256K1_SUPPORTS_CONCURRENCY Updates build definitions in configure.ac, CMakeLists.txt, src/CMakeLists.txt, CI workflow, and all source file references.
a8b2884 to
02b569d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR renames 22 externally-configured preprocessor macros (set via
-Dflags in configure.ac / CMakeLists.txt) to use theSECP256K1_prefix, addressing part of #1449.Renamed macros:
ENABLE_MODULE_{ECDH,RECOVERY,EXTRAKEYS,SCHNORRSIG,MUSIG,ELLSWIFT}VERIFYUSE_ASM_X86_64,USE_EXTERNAL_ASM,USE_FORCE_WIDEMUL_{INT128,INT128_STRUCT,INT64},USE_EXTERNAL_DEFAULT_CALLBACKSECMULT_WINDOW_SIZE,COMB_BLOCKS,COMB_TEETHEXHAUSTIVE_TEST_ORDERDETERMINISTIC,COVERAGE,VALGRIND,DEBUG_CONFIG,SUPPORTS_CONCURRENCYThese macros are defined via
-Dcompiler flags during the build. Generic names likeVERIFY,COVERAGE, andDETERMINISTICcan clash with flags from projects that build secp256k1 from source.These are macros relatively safe to rename: they are defined entirely by the build system, do not affect the public API or ABI, and have no interdependencies with internal macros. If this approach is accepted, the same pattern can be applied to the remaining internal macros identified in #1449.