Skip to content

Commit f373bee

Browse files
committed
Merge #16344: build: use #if HAVE_SYSTEM instead of defined(HAVE_SYSTEM)
976b034 [build]: use #if HAVE_SYSTEM instead of defined(HAVE_SYSTEM) (Sjors Provoost) Pull request description: It seems that `AC_DEFINE([HAVE_SYSTEM], [HAVE_STD__SYSTEM || HAVE_WSYSTEM]` causes `HAVE_SYSTEM` to always be defined, so we need to use `#if HAVE_SYSTEM` instead of `#if defined(HAVE_SYSTEM)`. Followup for #15457, can be tested with #12557. ACKs for top commit: dongcarl: ACK bitcoin/bitcoin@976b034. promag: ACK 976b034. fanquake: ACK 976b034 Tree-SHA512: b8cdd04c2ec399fd15638aef5d75ea0886ec1572d3cf4fcea27c193e1e6390344315908262cad8981a9b0a905ab9520619ce2ffe9a717f4ee6bfa8b028ebbdc6
2 parents 584168c + 976b034 commit f373bee

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

src/init.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -376,12 +376,12 @@ void SetupServerArgs()
376376
"-allowselfsignedrootcertificates", "-choosedatadir", "-lang=<lang>", "-min", "-resetguisettings", "-rootcertificates=<file>", "-splash", "-uiplatform"};
377377

378378
gArgs.AddArg("-version", "Print version and exit", false, OptionsCategory::OPTIONS);
379-
#if defined(HAVE_SYSTEM)
379+
#if HAVE_SYSTEM
380380
gArgs.AddArg("-alertnotify=<cmd>", "Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)", false, OptionsCategory::OPTIONS);
381381
#endif
382382
gArgs.AddArg("-assumevalid=<hex>", strprintf("If this block is in the chain assume that it and its ancestors are valid and potentially skip their script verification (0 to verify all, default: %s, testnet: %s)", defaultChainParams->GetConsensus().defaultAssumeValid.GetHex(), testnetChainParams->GetConsensus().defaultAssumeValid.GetHex()), false, OptionsCategory::OPTIONS);
383383
gArgs.AddArg("-blocksdir=<dir>", "Specify directory to hold blocks subdirectory for *.dat files (default: <datadir>)", false, OptionsCategory::OPTIONS);
384-
#if defined(HAVE_SYSTEM)
384+
#if HAVE_SYSTEM
385385
gArgs.AddArg("-blocknotify=<cmd>", "Execute command when the best block changes (%s in cmd is replaced by block hash)", false, OptionsCategory::OPTIONS);
386386
#endif
387387
gArgs.AddArg("-blockreconstructionextratxn=<n>", strprintf("Extra transactions to keep in memory for compact block reconstructions (default: %u)", DEFAULT_BLOCK_RECONSTRUCTION_EXTRA_TXN), false, OptionsCategory::OPTIONS);
@@ -583,7 +583,7 @@ std::string LicenseInfo()
583583
"\n";
584584
}
585585

586-
#if defined(HAVE_SYSTEM)
586+
#if HAVE_SYSTEM
587587
static void BlockNotifyCallback(bool initialSync, const CBlockIndex *pBlockIndex)
588588
{
589589
if (initialSync || !pBlockIndex)
@@ -1714,7 +1714,7 @@ bool AppInitMain(InitInterfaces& interfaces)
17141714
fHaveGenesis = true;
17151715
}
17161716

1717-
#if defined(HAVE_SYSTEM)
1717+
#if HAVE_SYSTEM
17181718
if (gArgs.IsArgSet("-blocknotify"))
17191719
uiInterface.NotifyBlockTip_connect(BlockNotifyCallback);
17201720
#endif

src/util/system.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1114,7 +1114,7 @@ fs::path GetSpecialFolderPath(int nFolder, bool fCreate)
11141114
}
11151115
#endif
11161116

1117-
#if defined(HAVE_SYSTEM)
1117+
#if HAVE_SYSTEM
11181118
void runCommand(const std::string& strCommand)
11191119
{
11201120
if (strCommand.empty()) return;

src/util/system.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ fs::path GetConfigFile(const std::string& confPath);
8989
#ifdef WIN32
9090
fs::path GetSpecialFolderPath(int nFolder, bool fCreate = true);
9191
#endif
92-
#if defined(HAVE_SYSTEM)
92+
#if HAVE_SYSTEM
9393
void runCommand(const std::string& strCommand);
9494
#endif
9595

src/validation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1050,7 +1050,7 @@ static CBlockIndex *pindexBestForkTip = nullptr, *pindexBestForkBase = nullptr;
10501050
static void AlertNotify(const std::string& strMessage)
10511051
{
10521052
uiInterface.NotifyAlertChanged();
1053-
#if defined(HAVE_SYSTEM)
1053+
#if HAVE_SYSTEM
10541054
std::string strCmd = gArgs.GetArg("-alertnotify", "");
10551055
if (strCmd.empty()) return;
10561056

src/wallet/init.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ void WalletInit::AddWalletOptions() const
5757
gArgs.AddArg("-wallet=<path>", "Specify wallet database path. Can be specified multiple times to load multiple wallets. Path is interpreted relative to <walletdir> if it is not absolute, and will be created if it does not exist (as a directory containing a wallet.dat file and log files). For backwards compatibility this will also accept names of existing data files in <walletdir>.)", false, OptionsCategory::WALLET);
5858
gArgs.AddArg("-walletbroadcast", strprintf("Make the wallet broadcast transactions (default: %u)", DEFAULT_WALLETBROADCAST), false, OptionsCategory::WALLET);
5959
gArgs.AddArg("-walletdir=<dir>", "Specify directory to hold wallets (default: <datadir>/wallets if it exists, otherwise <datadir>)", false, OptionsCategory::WALLET);
60-
#if defined(HAVE_SYSTEM)
60+
#if HAVE_SYSTEM
6161
gArgs.AddArg("-walletnotify=<cmd>", "Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)", false, OptionsCategory::WALLET);
6262
#endif
6363
gArgs.AddArg("-walletrbf", strprintf("Send transactions with full-RBF opt-in enabled (RPC only, default: %u)", DEFAULT_WALLET_RBF), false, OptionsCategory::WALLET);

src/wallet/wallet.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1050,7 +1050,7 @@ bool CWallet::AddToWallet(const CWalletTx& wtxIn, bool fFlushOnClose)
10501050
// Notify UI of new or updated transaction
10511051
NotifyTransactionChanged(this, hash, fInsertedNew ? CT_NEW : CT_UPDATED);
10521052

1053-
#if defined(HAVE_SYSTEM)
1053+
#if HAVE_SYSTEM
10541054
// notify an external script when a wallet transaction comes in or is updated
10551055
std::string strCmd = gArgs.GetArg("-walletnotify", "");
10561056

0 commit comments

Comments
 (0)