This PR replaces repetitive code with a helper macro.
util, refactor: Add UNIQUE_NAME helper macro #24355
pull hebasto wants to merge 1 commits into bitcoin:master from hebasto:220216-unique changing 5 files +11 −8-
hebasto commented at 1:01 PM on February 16, 2022: member
-
1633f5ec88
util, refactor: Add UNIQUE_NAME helper macro
This change replaces repetitive code with a helper macro.
-
laanwj commented at 1:29 PM on February 16, 2022: member
Concept ACK I don't know enough about token concatenation and macros to be sure this still works as expected, though :smile:
- DrahtBot added the label Utils/log/libs on Feb 16, 2022
-
laanwj commented at 8:58 PM on April 13, 2022: member
Tested ACK 1633f5ec8846408182cceb60dc88f022635f4002
diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index 9843382682579d9f65262b5a7dd7c81b5efa6340..7ae7aaf2035633bb4c0f31b22a6dbd8592be1b24 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -30,6 +30,14 @@ #include <functional> #include <optional> +#define NESTED_UNIQUE_NAME UNIQUE_NAME(uniquetest) + +int NESTED_UNIQUE_NAME; +int NESTED_UNIQUE_NAME; +int NESTED_UNIQUE_NAME; +int NESTED_UNIQUE_NAME; +int NESTED_UNIQUE_NAME; + using node::NodeContext; const std::function<std::string(const char*)> G_TRANSLATION_FUN = nullptr;objdump -toutput:0000000000000020 g O .bss 0000000000000004 uniquetest6 0000000000000024 g O .bss 0000000000000004 uniquetest5 0000000000000028 g O .bss 0000000000000004 uniquetest4 000000000000002c g O .bss 0000000000000004 uniquetest3 0000000000000030 g O .bss 0000000000000004 uniquetest2 - laanwj merged this on Apr 13, 2022
- laanwj closed this on Apr 13, 2022
- hebasto deleted the branch on Apr 13, 2022
- sidhujag referenced this in commit a421cbae7a on Apr 14, 2022
- DrahtBot locked this on Apr 13, 2023
Labels