Skip to content

Commit 3c098a8

Browse files
committed
Merge #11651: refactor: Make all #includes relative to project root (laanwj, MeshCollider, ryanofsky)
7b91b5f Remove trailing whitespace causing travis failure (MeshCollider) 434f5a2 Recommend #include<> syntax in developer notes (Russell Yanofsky) 96b9281 refactor: Include obj/build.h instead of build.h (Wladimir J. van der Laan) 138016b test: refactor: Use absolute include paths for test data files (Wladimir J. van der Laan) e7b3163 qt: refactor: Changes to make include paths absolute (Wladimir J. van der Laan) 0c71521 build: Remove -I for everything but project root (Wladimir J. van der Laan) 5b56ec9 qt: refactor: Use absolute include paths in .ui files (Wladimir J. van der Laan) 1a44534 scripted-diff: Replace #include "" with #include <> (ryanofsky) (MeshCollider) Pull request description: Rebase of #11053 Previously started by @laanwj, ACK'ed by promag, ryanofsky, jonasschnelli, and concept-ACK'ed by practicalswift and jnewbery. Thus should be almost RTM :) Tree-SHA512: d8d25248309deb06a54686c4a6bafd290ba69dcd0df391a50d1caed2c22ff2659be442459bdd9d1fc3b6a1360ba0804a907b1402d206df3e1cb6e8924e3c7f3e
2 parents 54aedc0 + 7b91b5f commit 3c098a8

File tree

370 files changed

+2071
-2064
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

370 files changed

+2071
-2064
lines changed

doc/developer-notes.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,14 @@ namespace {
492492

493493
- *Rationale*: Avoids confusion about the namespace context
494494

495+
- Prefer `#include <primitives/transaction.h>` bracket syntax instead of
496+
`#include "primitives/transactions.h"`` quote syntax when possible.
497+
498+
- *Rationale*: Bracket syntax is less ambiguous because the preprocessor
499+
searches a fixed list of include directories without taking location of the
500+
source file into account. This allows quoted includes to stand out more when
501+
the location of the source file actually is relevant.
502+
495503
GUI
496504
-----
497505

src/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ else
1818
LIBUNIVALUE = $(UNIVALUE_LIBS)
1919
endif
2020

21-
BITCOIN_INCLUDES=-I$(builddir) -I$(builddir)/obj $(BDB_CPPFLAGS) $(BOOST_CPPFLAGS) $(LEVELDB_CPPFLAGS) $(CRYPTO_CFLAGS) $(SSL_CFLAGS)
21+
BITCOIN_INCLUDES=-I$(builddir) $(BDB_CPPFLAGS) $(BOOST_CPPFLAGS) $(LEVELDB_CPPFLAGS) $(CRYPTO_CFLAGS) $(SSL_CFLAGS)
2222

2323
BITCOIN_INCLUDES += -I$(srcdir)/secp256k1/include
2424
BITCOIN_INCLUDES += $(UNIVALUE_CFLAGS)

src/Makefile.qt.include

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,8 +362,7 @@ RES_MOVIES = $(wildcard $(srcdir)/qt/res/movies/spinner-*.png)
362362

363363
BITCOIN_RC = qt/res/bitcoin-qt-res.rc
364364

365-
BITCOIN_QT_INCLUDES = -I$(builddir)/qt -I$(srcdir)/qt -I$(srcdir)/qt/forms \
366-
-I$(builddir)/qt/forms -DQT_NO_KEYWORDS
365+
BITCOIN_QT_INCLUDES = -DQT_NO_KEYWORDS
367366

368367
qt_libbitcoinqt_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(BITCOIN_QT_INCLUDES) \
369368
$(QT_INCLUDES) $(QT_DBUS_INCLUDES) $(PROTOBUF_CFLAGS) $(QR_CFLAGS)

src/Makefile.test.include

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ BITCOIN_TESTS += \
9696
endif
9797

9898
test_test_bitcoin_SOURCES = $(BITCOIN_TESTS) $(JSON_TEST_FILES) $(RAW_TEST_FILES)
99-
test_test_bitcoin_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) -I$(builddir)/test/ $(TESTDEFS) $(EVENT_CFLAGS)
99+
test_test_bitcoin_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(TESTDEFS) $(EVENT_CFLAGS)
100100
test_test_bitcoin_LDADD =
101101
if ENABLE_WALLET
102102
test_test_bitcoin_LDADD += $(LIBBITCOIN_WALLET)

src/addrdb.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33
// Distributed under the MIT software license, see the accompanying
44
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
55

6-
#include "addrdb.h"
7-
8-
#include "addrman.h"
9-
#include "chainparams.h"
10-
#include "clientversion.h"
11-
#include "fs.h"
12-
#include "hash.h"
13-
#include "random.h"
14-
#include "streams.h"
15-
#include "tinyformat.h"
16-
#include "util.h"
6+
#include <addrdb.h>
7+
8+
#include <addrman.h>
9+
#include <chainparams.h>
10+
#include <clientversion.h>
11+
#include <fs.h>
12+
#include <hash.h>
13+
#include <random.h>
14+
#include <streams.h>
15+
#include <tinyformat.h>
16+
#include <util.h>
1717

1818
namespace {
1919

src/addrdb.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
#ifndef BITCOIN_ADDRDB_H
77
#define BITCOIN_ADDRDB_H
88

9-
#include "fs.h"
10-
#include "serialize.h"
9+
#include <fs.h>
10+
#include <serialize.h>
1111

1212
#include <string>
1313
#include <map>

src/addrman.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
// Distributed under the MIT software license, see the accompanying
44
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
55

6-
#include "addrman.h"
6+
#include <addrman.h>
77

8-
#include "hash.h"
9-
#include "serialize.h"
10-
#include "streams.h"
8+
#include <hash.h>
9+
#include <serialize.h>
10+
#include <streams.h>
1111

1212
int CAddrInfo::GetTriedBucket(const uint256& nKey) const
1313
{

src/addrman.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
#ifndef BITCOIN_ADDRMAN_H
77
#define BITCOIN_ADDRMAN_H
88

9-
#include "netaddress.h"
10-
#include "protocol.h"
11-
#include "random.h"
12-
#include "sync.h"
13-
#include "timedata.h"
14-
#include "util.h"
9+
#include <netaddress.h>
10+
#include <protocol.h>
11+
#include <random.h>
12+
#include <sync.h>
13+
#include <timedata.h>
14+
#include <util.h>
1515

1616
#include <map>
1717
#include <set>

src/arith_uint256.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
// Distributed under the MIT software license, see the accompanying
44
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
55

6-
#include "arith_uint256.h"
6+
#include <arith_uint256.h>
77

8-
#include "uint256.h"
9-
#include "utilstrencodings.h"
10-
#include "crypto/common.h"
8+
#include <uint256.h>
9+
#include <utilstrencodings.h>
10+
#include <crypto/common.h>
1111

1212
#include <stdio.h>
1313
#include <string.h>

src/base58.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
// Distributed under the MIT software license, see the accompanying
33
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
44

5-
#include "base58.h"
5+
#include <base58.h>
66

7-
#include "bech32.h"
8-
#include "hash.h"
9-
#include "script/script.h"
10-
#include "uint256.h"
11-
#include "utilstrencodings.h"
7+
#include <bech32.h>
8+
#include <hash.h>
9+
#include <script/script.h>
10+
#include <uint256.h>
11+
#include <utilstrencodings.h>
1212

1313
#include <boost/variant/apply_visitor.hpp>
1414
#include <boost/variant/static_visitor.hpp>

0 commit comments

Comments
 (0)