From e229b5d291eefbf05e77988149d3ba2dc0059575 Mon Sep 17 00:00:00 2001 From: jhuntley Date: Thu, 26 Feb 2015 16:05:53 -0500 Subject: [PATCH] Revert all asio.h includes except for in 2 files, DebuggingStateWrapper.h and Transact.cpp. After enabling WIN32_LEAN_AND_MEAN, all the asio.h include issues, commit 20b6e24ffcab088e71092e07030a377d3135da3c, went away. --- TestHelper.cpp | 2 -- TestHelper.h | 2 -- checkRandomTest.cpp | 3 --- createRandomTest.cpp | 2 -- fork.cpp | 2 -- genesis.cpp | 4 +--- hexPrefix.cpp | 2 -- net.cpp | 10 ++++------ rlp.cpp | 2 -- state.cpp | 2 -- trie.cpp | 2 -- txTest.cpp | 2 -- vm.cpp | 2 -- vm.h | 2 -- whisperTopic.cpp | 32 +++++++++++++++----------------- 15 files changed, 20 insertions(+), 51 deletions(-) diff --git a/TestHelper.cpp b/TestHelper.cpp index 16f0d6d10..82add295e 100644 --- a/TestHelper.cpp +++ b/TestHelper.cpp @@ -24,8 +24,6 @@ #include #include -// Make sure boost/asio.hpp is included before windows.h. -#include #include #include diff --git a/TestHelper.h b/TestHelper.h index 40294b034..6f9143c5c 100644 --- a/TestHelper.h +++ b/TestHelper.h @@ -23,8 +23,6 @@ #include -// Make sure boost/asio.hpp is included before windows.h. -#include #include #include "JsonSpiritHeaders.h" diff --git a/checkRandomTest.cpp b/checkRandomTest.cpp index f1daaecbf..e3442d438 100644 --- a/checkRandomTest.cpp +++ b/checkRandomTest.cpp @@ -20,9 +20,6 @@ * Check a random test and return 0/1 for success or failure. To be used for efficiency in the random test simulation. */ -// Make sure boost/asio.hpp is included before windows.h. -#include - #include #include #include diff --git a/createRandomTest.cpp b/createRandomTest.cpp index 140a7fb38..55e023759 100644 --- a/createRandomTest.cpp +++ b/createRandomTest.cpp @@ -24,8 +24,6 @@ #include #include -// Make sure boost/asio.hpp is included before windows.h. -#include #include #include diff --git a/fork.cpp b/fork.cpp index 65c5dd3b5..a2eb6f4eb 100644 --- a/fork.cpp +++ b/fork.cpp @@ -20,8 +20,6 @@ * Tests for different forking behavior */ -// Make sure boost/asio.hpp is included before windows.h. -#include #include #include diff --git a/genesis.cpp b/genesis.cpp index a450b79fc..5ac3ea2a8 100644 --- a/genesis.cpp +++ b/genesis.cpp @@ -23,8 +23,6 @@ #include #include -// Make sure boost/asio.hpp is included before windows.h. -#include #include #include "JsonSpiritHeaders.h" @@ -44,7 +42,7 @@ BOOST_AUTO_TEST_CASE(emptySHA3Types) { h256 emptyListSHA3(fromHex("1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347")); BOOST_REQUIRE_EQUAL(emptyListSHA3, EmptyListSHA3); - + h256 emptySHA3(fromHex("c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470")); BOOST_REQUIRE_EQUAL(emptySHA3, EmptySHA3); } diff --git a/hexPrefix.cpp b/hexPrefix.cpp index 5875d62f6..da294ba5b 100644 --- a/hexPrefix.cpp +++ b/hexPrefix.cpp @@ -22,8 +22,6 @@ #include -// Make sure boost/asio.hpp is included before windows.h. -#include #include #include "JsonSpiritHeaders.h" diff --git a/net.cpp b/net.cpp index fafcc1ff6..831c283e2 100644 --- a/net.cpp +++ b/net.cpp @@ -19,8 +19,6 @@ * @date 2014 */ -// Make sure boost/asio.hpp is included before windows.h. -#include #include #include @@ -192,22 +190,22 @@ BOOST_AUTO_TEST_CASE(kademlia) node.populateAll(); clog << "NodeTable:\n" << *node.nodeTable.get() << endl; - + auto nodes = node.nodeTable->nodes(); nodes.sort(); - + node.nodeTable->reset(); clog << "NodeTable:\n" << *node.nodeTable.get() << endl; node.populate(1); clog << "NodeTable:\n" << *node.nodeTable.get() << endl; - + node.nodeTable->discover(); this_thread::sleep_for(chrono::milliseconds(2000)); clog << "NodeTable:\n" << *node.nodeTable.get() << endl; BOOST_REQUIRE_EQUAL(node.nodeTable->count(), 8); - + auto netNodes = node.nodeTable->nodes(); netNodes.sort(); diff --git a/rlp.cpp b/rlp.cpp index fc4f858ed..9062b54f4 100644 --- a/rlp.cpp +++ b/rlp.cpp @@ -23,8 +23,6 @@ #include #include -// Make sure boost/asio.hpp is included before windows.h. -#include #include #include diff --git a/state.cpp b/state.cpp index e2201f241..17ebe2b77 100644 --- a/state.cpp +++ b/state.cpp @@ -20,8 +20,6 @@ * State test functions. */ -// Make sure boost/asio.hpp is included before windows.h. -#include #include #include diff --git a/trie.cpp b/trie.cpp index 312749752..dd335b4a6 100644 --- a/trie.cpp +++ b/trie.cpp @@ -23,8 +23,6 @@ #include #include -// Make sure boost/asio.hpp is included before windows.h. -#include #include #include "JsonSpiritHeaders.h" diff --git a/txTest.cpp b/txTest.cpp index 3f67c0a2f..e2a16e16c 100644 --- a/txTest.cpp +++ b/txTest.cpp @@ -20,8 +20,6 @@ * Simple peer transaction send test. */ -// Make sure boost/asio.hpp is included before windows.h. -#include #include #include diff --git a/vm.cpp b/vm.cpp index 00ba82aaf..e78753e6a 100644 --- a/vm.cpp +++ b/vm.cpp @@ -22,8 +22,6 @@ #include -// Make sure boost/asio.hpp is included before windows.h. -#include #include #include diff --git a/vm.h b/vm.h index 03b3b4e5e..f27bce50b 100644 --- a/vm.h +++ b/vm.h @@ -26,8 +26,6 @@ along with cpp-ethereum. If not, see . #include #include -// Make sure boost/asio.hpp is included before windows.h. -#include #include #include diff --git a/whisperTopic.cpp b/whisperTopic.cpp index 0937ab922..0ea681b67 100644 --- a/whisperTopic.cpp +++ b/whisperTopic.cpp @@ -20,8 +20,6 @@ */ #include -// Make sure boost/asio.hpp is included before windows.h. -#include #include #include @@ -44,10 +42,10 @@ BOOST_AUTO_TEST_CASE(topic) Host host1("Test", NetworkPreferences(30303, "127.0.0.1", false, true)); auto whost1 = host1.registerCapability(new WhisperHost()); host1.start(); - + while (!host1.isStarted()) this_thread::sleep_for(chrono::milliseconds(2)); - + bool started = false; unsigned result = 0; std::thread listener([&]() @@ -75,19 +73,19 @@ BOOST_AUTO_TEST_CASE(topic) } this_thread::sleep_for(chrono::milliseconds(50)); } - + }); - + Host host2("Test", NetworkPreferences(30300, "127.0.0.1", false, true)); auto whost2 = host2.registerCapability(new WhisperHost()); host2.start(); - + while (!host2.isStarted()) this_thread::sleep_for(chrono::milliseconds(2)); - + this_thread::sleep_for(chrono::milliseconds(100)); host2.addNode(host1.id(), "127.0.0.1", 30303, 30303); - + this_thread::sleep_for(chrono::milliseconds(500)); while (!started) @@ -111,7 +109,7 @@ BOOST_AUTO_TEST_CASE(forwarding) cnote << "Testing Whisper forwarding..."; auto oldLogVerbosity = g_logVerbosity; g_logVerbosity = 0; - + // Host must be configured not to share peers. Host host1("Listner", NetworkPreferences(30303, "", false, true)); host1.setIdealPeerCount(0); @@ -119,7 +117,7 @@ BOOST_AUTO_TEST_CASE(forwarding) host1.start(); while (!host1.isStarted()) this_thread::sleep_for(chrono::milliseconds(2)); - + unsigned result = 0; bool done = false; @@ -146,7 +144,7 @@ BOOST_AUTO_TEST_CASE(forwarding) } }); - + // Host must be configured not to share peers. Host host2("Forwarder", NetworkPreferences(30305, "", false, true)); host2.setIdealPeerCount(1); @@ -154,7 +152,7 @@ BOOST_AUTO_TEST_CASE(forwarding) host2.start(); while (!host2.isStarted()) this_thread::sleep_for(chrono::milliseconds(2)); - + Public fwderid; bool startedForwarder = false; std::thread forwarder([&]() @@ -214,7 +212,7 @@ BOOST_AUTO_TEST_CASE(asyncforwarding) unsigned result = 0; bool done = false; - + // Host must be configured not to share peers. Host host1("Forwarder", NetworkPreferences(30305, "", false, true)); host1.setIdealPeerCount(1); @@ -227,7 +225,7 @@ BOOST_AUTO_TEST_CASE(asyncforwarding) std::thread forwarder([&]() { setThreadName("forwarder"); - + this_thread::sleep_for(chrono::milliseconds(500)); // ph.addNode("127.0.0.1", 30303, 30303); @@ -249,7 +247,7 @@ BOOST_AUTO_TEST_CASE(asyncforwarding) while (!startedForwarder) this_thread::sleep_for(chrono::milliseconds(2)); - + { Host host2("Sender", NetworkPreferences(30300, "", false, true)); host2.setIdealPeerCount(1); @@ -261,7 +259,7 @@ BOOST_AUTO_TEST_CASE(asyncforwarding) while (!host2.peerCount()) this_thread::sleep_for(chrono::milliseconds(5)); - + KeyPair us = KeyPair::create(); whost2->post(us.sec(), RLPStream().append(1).out(), BuildTopic("test")); this_thread::sleep_for(chrono::milliseconds(250));