-
Notifications
You must be signed in to change notification settings - Fork 35.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check usages of #if defined(...)
#16419
Comments
#if define(...)
#if defined(...)
I have gone through |
Looks like #16547 (comment) is up for grabs? |
I'm going to revive #16547 and look at turning on |
I looked over the uses in 8be652e and found one bug: LevelDB is using |
Is this issue up for grab? |
It is. See #16547. |
On the master branch @ 4e8a765 plus #27696, there are only two cases in our build system of explicit unconditional usage of the
That means that the All other use cases of the Moreover, descriptions like "Define to 1 to enable wallet functions" should be replaced with "Define this symbol to enable wallet functions" as the actual value of the defined macro does not matter at all. The bottom line:
These cases are It is worth mentioning that macros like I don't think any changes in the source files are required. However, in Developer Notes, we can recommend to use |
…MQ is not available fa5831b build: Do not define `ENABLE_ZMQ` when ZMQ is not available (Hennadii Stepanov) Pull request description: A new behavior is consistent with the other optional dependencies. The source code contains `#if ENABLE_ZMQ` lines only: ``` $ git grep ENABLE_ZMQ -- src/*.cpp src/init.cpp:#if ENABLE_ZMQ src/init.cpp:#if ENABLE_ZMQ src/init.cpp:#if ENABLE_ZMQ src/init.cpp:#if ENABLE_ZMQ src/init.cpp:#if ENABLE_ZMQ ``` Change in description line -- "Define to 1..." --> "Define this symbol.." -- is motivated by the fact that the actual value of the defined `ENABLE_ZMQ` macro does not matter at all. Related to: - bitcoin/bitcoin#16419 - bitcoin/bitcoin#25302 ACKs for top commit: TheCharlatan: ACK fa5831b jarolrod: ACK fa5831b Tree-SHA512: 5e72ff0d34c4b33205338daea0aae8d7aa0e48fd633e21af01af32b7ddb0532ef68dd3dd74deb2c1d2599691929617e8c09676bcbaaf7d669b88816f866f1db2
Going to close this now that #29876 is merged. |
It would seem that in most cases, we want
#if ...
instead of#if defined(...)
, so let's make sure that when we say#if defined(...)
, we actually mean it.Inspiration: #16344
The text was updated successfully, but these errors were encountered: