Commit graph

27 commits

Author SHA1 Message Date
Sjors Provoost 3c84d85f7d
[build] msvc: add boost::process
* AppVeyor boost-process vcpkg package.
* Tell Boost linter to ignore it
* Add HAVE_BOOST_PROCESS for MSVC build (bitcoin_config.h)
2020-07-31 13:38:09 +02:00
Cory Fields f1a0314c53
gui: change combiner for signals to optional_last_value
optional_last_value, which does not throw, has replaced optional_value as
boost's default combiner. Besides being better supported, it also doesn't
trigger gcc's -Wmaybe-unitialized warning, presumably because exceptions no
longer bubble-up out of signals:

```bash
boost/signals2/last_value.hpp:54:36: warning: '*((void*)& value +1)' may be used uninitialized in this function [-Wmaybe-uninitialized]
	if(value) return value.get();
```

The change in default happened in Boost 1.39.0 (along with the
introduction of the signals 2 library. More information is available here:

https://www.boost.org/doc/libs/1_73_0/doc/html/signals2/rationale.html#id-1.3.36.9.4

and here:

https://www.boost.org/doc/libs/1_73_0/doc/html/boost/signals2/optional_last_value.html

Co-authored-by: fanquake <fanquake@gmail.com>
2020-07-01 21:40:51 +08:00
Hennadii Stepanov 89f9fef1f7 refactor: Specify boost/thread/thread.hpp explicitly 2020-06-04 10:05:54 -04:00
MarcoFalke fa488f131f
scripted-diff: Bump copyright headers
-BEGIN VERIFY SCRIPT-
./contrib/devtools/copyright_header.py update ./
-END VERIFY SCRIPT-
2020-04-16 13:33:09 -04:00
Anthony Towns d0ebd93270 scheduler: switch from boost to std
Changes from boost::chrono to std::chrono, boost::condition_var to
std::condition_var, boost::mutex to sync.h Mutex, and reverselock.h to
sync.h REVERSE_LOCK. Also adds threadsafety annotations to CScheduler
members.
2020-03-06 23:14:08 +10:00
Wladimir J. van der Laan 3a037d0067 test: Add crc32c exception to various linters and generation scripts 2020-01-28 17:01:48 +01:00
MarcoFalke aaaaad6ac9
scripted-diff: Bump copyright of files changed in 2019
-BEGIN VERIFY SCRIPT-
./contrib/devtools/copyright_header.py update ./
-END VERIFY SCRIPT-
2019-12-30 10:42:20 +13:00
Kristaps Kaupe 490da639cb
Make lint-includes.sh work from any directory 2019-09-04 22:36:09 +03:00
Chun Kuan Lee cb53b825c2 scripted-diff: Replace boost::bind with std::bind
-BEGIN VERIFY SCRIPT-
for j in $(seq 1 5)
do
    sed -i "s/ _${j}/ std::placeholders::_${j}/g" $(git grep --name-only " _${j}" -- '*.cpp' '*.h')
done
sed -i "s/boost::bind/std::bind/g" $(git grep --name-only boost::bind -- '*.cpp' '*.h')
sed -i "s/boost::ref/std::ref/g" $(git grep --name-only boost::ref -- '*.cpp' '*.h')
sed -i '/boost\/bind/d' $(git grep --name-only boost/bind)
-END VERIFY SCRIPT-
2018-10-20 02:29:59 +08:00
Chun Kuan Lee 2c3eade704 Make fs::path::string() always return utf-8 string 2018-09-23 03:43:25 +08:00
Wladimir J. van der Laan 362518791a
Merge #13734: gui: Drop boost::scoped_array and use wchar_t API explicitly on Windows
bb6ca65f98 gui: get special folder in unicode (Chun Kuan Lee)
1c5d225853 Drop boost::scoped_array (Chun Kuan Lee)

Pull request description:

  Drop boost::scoped_array and simplify the code.

  `TCHAR` should be defined as `wchar_t` if `UNICODE` is defined. So we can use `.toStdWString().c_str()` to get wchar_t C-style string.

  Fix #13819

Tree-SHA512: 3fd4aa784129c9d1576b01e6ee27faa42d793e152d132f2dde504d917dad3a8e95e065fcbc54a3895d74fb6b2a9ed4f5ec67d893395552f585e225486a84a454
2018-09-11 10:58:10 +02:00
Wladimir J. van der Laan 5924dadc2f
Merge #13671: Remove the boost/algorithm/string/case_conv.hpp dependency
b193d5a443 Removes the Boost case_conv.hpp dependency. (251)
7a208d9fad Implements custom tolower and toupper functions. (251)
e2ba043b8d Implements ParseNetwork unit test. (251)

Pull request description:

  This pull request removes the `boost/algorithm/string/case_conv.hpp` dependency from the project.

  `boost/algorithm/string/case_conv.hpp` is included for the `boost::to_lower` and `boost::to_upper` template functions.

  We can replace the calls to these functions with straightforward alternative implementations that use the C++ Standard Library, because the functions are called with `std::string` objects that use standard 7-bit ASCII characters as argument.

  The refactored implementation should work without the explicit `static_cast<unsigned char>` cast and `unsigned char` lambda return type. Both have been added defensively and to be explicit. Especially in case of the former, behaviour is undefined (potentially result in a crash) if the `std::toupper` argument is not an `unsigned char`.

  A potential alternative, maybe even preferred, implementation to address the `boost::to_lower` function call in `ParseNetwork(std::string)` could have been:

  ```c++
  if (net == "ipv4" || net == "IPv4") return NET_IPV4;
  if (net == "ipv6" || net == "IPv6") return NET_IPV6;
  ```
  This alternative implementation would however change the external behaviour of `ParseNetwork(std::string)`.

  This pull requests includes a unit test to validate the implementation of `ParseNetwork(std::string)`  prior and after the removal of the `case_conv.hpp` dependency.

  `boost/algorithm/string/case_conv.hpp` has been removed from the `EXPECTED_BOOST_INCLUDES` in `test/lint/lint-includes.sh` because it is no longer required.

Tree-SHA512: d803ae709f2368a3efb223097384a722436955bce0c44a1a5cffd0abb3164be0cce85ba0e9ebd9408166df3f1a95ea0c0d29e3a2534af2fae206c0419d67fde9
2018-08-29 14:59:49 +02:00
251 b193d5a443 Removes the Boost case_conv.hpp dependency.
This commit removes the `boost/algorithm/string/case_conv.hpp` dependency from the project. It replaces the `boost::to_lower` and `boost::to_upper` functions with custom functions that are locale independent and ASCII deterministic.
2018-08-28 18:42:53 +02:00
Chun Kuan Lee 1661a472b8 add unicode compatible file_lock for Windows
boost::interprocess::file_lock cannot open the files that contain characters which cannot be parsed by the user's code page on Windows.
This commit add a new class to handle those specific file for Windows.
2018-08-28 00:55:13 +08:00
Chun Kuan Lee 1c5d225853 Drop boost::scoped_array 2018-08-04 01:11:42 +08:00
251 e3245f2e7b Removes Boost predicate.hpp dependency
This is a squashed commit that squashes the following commits:

This commit removes the `boost/algorithm/string/predicate.hpp` dependenc
from the project by replacing the function calls to `boost::algorithm::starts_with`
`boost::algorithm::ends_with` and `all` with respectively C++11'
`std::basic_string::front`, `std::basic_string::back`, `std::all_of` function calls

This commit replaces `boost::algorithm::is_digit` with  a locale independent isdigi
function, because the use of the standard library's `isdigit` and `std::isdigit
functions is discoraged in the developer notes
2018-07-22 21:34:45 +02:00
251 5f019d5354 Removes the boost/algorithm/string/join dependency
This commit removes the `boost/algorithm/string/join` dependency
from the project by replacing `boost::algorithm::join` with
a simple helper function.
2018-07-21 01:14:25 +02:00
Wladimir J. van der Laan 2dc5ab6378
Merge #13482: Remove boost::program_options dependency
f447a0a707 Remove program options from build system (Chun Kuan Lee)
11588c639e Replace boost program_options (Chun Kuan Lee)

Pull request description:

  Concept from #12744, but without parsing negated options.

Tree-SHA512: 7f418744bb8934e313d77a5f162633746ef5d043de802b9c9cd9f7c1842e7e566eb5f171cd9e2cc13317281b2449c6fbd553fa4f09b837e6af2f5d2b2aabdca2
2018-07-20 16:45:44 +02:00
Chun Kuan Lee f447a0a707 Remove program options from build system 2018-07-18 02:48:34 +00:00
practicalswift 962d8eed5b Remove boost dependency (boost/assign/std/vector.hpp) 2018-06-27 17:45:18 +02:00
DesWurstes 000000035b Obsolete #!/bin/bash shebang 2018-06-20 11:12:41 +03:00
practicalswift 3352da8da1 Add "export LC_ALL=C" to all shell scripts 2018-06-14 15:27:52 +02:00
Wladimir J. van der Laan 7c32b414b6
Merge #13230: Simplify include analysis by enforcing the developer guide's include syntax
16e3cd380a Clarify include recommendation (practicalswift)
6d10f43738 Enforce the use of bracket syntax includes ("#include <foo.h>") (practicalswift)
906bee8e5f Use bracket syntax includes ("#include <foo.h>") (practicalswift)

Pull request description:

  When analysing includes in the project it is often assumed that the preferred bracket include syntax (`#include <foo.h>`) mentioned in `developer-docs.md` is used consistently. @sipa:s excellent circular dependencies script [`circular-dependencies.py`](50c69b7801/contrib/devtools/circular-dependencies.py) (#13228) is an example of a script making this reasonable assumption.

  This PR enables automatic Travis checking of the include syntax making sure that the bracket syntax includes (`#include <foo.h>`) is used consistently.

Tree-SHA512: a414921aabe8e487ebed42f3f1cbd02fecd1add385065c1f2244cd602c31889e61fea5a801507ec501ef9bd309b05d3c999f915cec1c2b44f085bb0d2835c182
2018-06-11 20:24:58 +02:00
Ben Woosley 9d6c9dbb88
lint: Add linter to error on #include <*.cpp>
Files should depend on one another by interface, not by implementation.
This checks for quoted includes as well.

With practicalswift
2018-06-06 02:11:25 -07:00
practicalswift 6d10f43738 Enforce the use of bracket syntax includes ("#include <foo.h>") 2018-06-06 11:09:05 +02:00
practicalswift 81bbd32a2c build: Guard against accidental introduction of new Boost dependencies 2018-06-04 10:08:08 +02:00
MarcoFalke fa3c910bfe
test: Move linters to test/lint, add readme 2018-05-24 12:02:15 -04:00
Renamed from contrib/devtools/lint-includes.sh (Browse further)