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.

This commit is contained in:
jhuntley 2015-02-26 16:05:53 -05:00
parent 5ae585f7cf
commit e229b5d291
15 changed files with 20 additions and 51 deletions

View File

@ -24,8 +24,6 @@
#include <thread> #include <thread>
#include <chrono> #include <chrono>
// Make sure boost/asio.hpp is included before windows.h.
#include <boost/asio.hpp>
#include <boost/filesystem/path.hpp> #include <boost/filesystem/path.hpp>
#include <libethereum/Client.h> #include <libethereum/Client.h>

View File

@ -23,8 +23,6 @@
#include <functional> #include <functional>
// Make sure boost/asio.hpp is included before windows.h.
#include <boost/asio.hpp>
#include <boost/test/unit_test.hpp> #include <boost/test/unit_test.hpp>
#include "JsonSpiritHeaders.h" #include "JsonSpiritHeaders.h"

View File

@ -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. * 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 <boost/asio.hpp>
#include <libdevcore/Common.h> #include <libdevcore/Common.h>
#include <libdevcore/Exceptions.h> #include <libdevcore/Exceptions.h>
#include <libdevcore/Log.h> #include <libdevcore/Log.h>

View File

@ -24,8 +24,6 @@
#include <iostream> #include <iostream>
#include <chrono> #include <chrono>
// Make sure boost/asio.hpp is included before windows.h.
#include <boost/asio.hpp>
#include <boost/random.hpp> #include <boost/random.hpp>
#include <boost/filesystem/path.hpp> #include <boost/filesystem/path.hpp>

View File

@ -20,8 +20,6 @@
* Tests for different forking behavior * Tests for different forking behavior
*/ */
// Make sure boost/asio.hpp is included before windows.h.
#include <boost/asio.hpp>
#include <boost/test/unit_test.hpp> #include <boost/test/unit_test.hpp>
#include <boost/filesystem/operations.hpp> #include <boost/filesystem/operations.hpp>

View File

@ -23,8 +23,6 @@
#include <fstream> #include <fstream>
#include <random> #include <random>
// Make sure boost/asio.hpp is included before windows.h.
#include <boost/asio.hpp>
#include <boost/test/unit_test.hpp> #include <boost/test/unit_test.hpp>
#include "JsonSpiritHeaders.h" #include "JsonSpiritHeaders.h"
@ -44,7 +42,7 @@ BOOST_AUTO_TEST_CASE(emptySHA3Types)
{ {
h256 emptyListSHA3(fromHex("1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347")); h256 emptyListSHA3(fromHex("1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"));
BOOST_REQUIRE_EQUAL(emptyListSHA3, EmptyListSHA3); BOOST_REQUIRE_EQUAL(emptyListSHA3, EmptyListSHA3);
h256 emptySHA3(fromHex("c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470")); h256 emptySHA3(fromHex("c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470"));
BOOST_REQUIRE_EQUAL(emptySHA3, EmptySHA3); BOOST_REQUIRE_EQUAL(emptySHA3, EmptySHA3);
} }

View File

@ -22,8 +22,6 @@
#include <fstream> #include <fstream>
// Make sure boost/asio.hpp is included before windows.h.
#include <boost/asio.hpp>
#include <boost/test/unit_test.hpp> #include <boost/test/unit_test.hpp>
#include "JsonSpiritHeaders.h" #include "JsonSpiritHeaders.h"

10
net.cpp
View File

@ -19,8 +19,6 @@
* @date 2014 * @date 2014
*/ */
// Make sure boost/asio.hpp is included before windows.h.
#include <boost/asio.hpp>
#include <boost/test/unit_test.hpp> #include <boost/test/unit_test.hpp>
#include <libdevcore/Worker.h> #include <libdevcore/Worker.h>
@ -192,22 +190,22 @@ BOOST_AUTO_TEST_CASE(kademlia)
node.populateAll(); node.populateAll();
clog << "NodeTable:\n" << *node.nodeTable.get() << endl; clog << "NodeTable:\n" << *node.nodeTable.get() << endl;
auto nodes = node.nodeTable->nodes(); auto nodes = node.nodeTable->nodes();
nodes.sort(); nodes.sort();
node.nodeTable->reset(); node.nodeTable->reset();
clog << "NodeTable:\n" << *node.nodeTable.get() << endl; clog << "NodeTable:\n" << *node.nodeTable.get() << endl;
node.populate(1); node.populate(1);
clog << "NodeTable:\n" << *node.nodeTable.get() << endl; clog << "NodeTable:\n" << *node.nodeTable.get() << endl;
node.nodeTable->discover(); node.nodeTable->discover();
this_thread::sleep_for(chrono::milliseconds(2000)); this_thread::sleep_for(chrono::milliseconds(2000));
clog << "NodeTable:\n" << *node.nodeTable.get() << endl; clog << "NodeTable:\n" << *node.nodeTable.get() << endl;
BOOST_REQUIRE_EQUAL(node.nodeTable->count(), 8); BOOST_REQUIRE_EQUAL(node.nodeTable->count(), 8);
auto netNodes = node.nodeTable->nodes(); auto netNodes = node.nodeTable->nodes();
netNodes.sort(); netNodes.sort();

View File

@ -23,8 +23,6 @@
#include <fstream> #include <fstream>
#include <sstream> #include <sstream>
// Make sure boost/asio.hpp is included before windows.h.
#include <boost/asio.hpp>
#include <boost/test/unit_test.hpp> #include <boost/test/unit_test.hpp>
#include <libdevcore/Log.h> #include <libdevcore/Log.h>

View File

@ -20,8 +20,6 @@
* State test functions. * State test functions.
*/ */
// Make sure boost/asio.hpp is included before windows.h.
#include <boost/asio.hpp>
#include <boost/filesystem/operations.hpp> #include <boost/filesystem/operations.hpp>
#include <boost/test/unit_test.hpp> #include <boost/test/unit_test.hpp>

View File

@ -23,8 +23,6 @@
#include <fstream> #include <fstream>
#include <random> #include <random>
// Make sure boost/asio.hpp is included before windows.h.
#include <boost/asio.hpp>
#include <boost/test/unit_test.hpp> #include <boost/test/unit_test.hpp>
#include "JsonSpiritHeaders.h" #include "JsonSpiritHeaders.h"

View File

@ -20,8 +20,6 @@
* Simple peer transaction send test. * Simple peer transaction send test.
*/ */
// Make sure boost/asio.hpp is included before windows.h.
#include <boost/asio.hpp>
#include <boost/test/unit_test.hpp> #include <boost/test/unit_test.hpp>
#include <boost/filesystem/operations.hpp> #include <boost/filesystem/operations.hpp>

2
vm.cpp
View File

@ -22,8 +22,6 @@
#include <chrono> #include <chrono>
// Make sure boost/asio.hpp is included before windows.h.
#include <boost/asio.hpp>
#include <boost/filesystem.hpp> #include <boost/filesystem.hpp>
#include <libethereum/Executive.h> #include <libethereum/Executive.h>

2
vm.h
View File

@ -26,8 +26,6 @@ along with cpp-ethereum. If not, see <http://www.gnu.org/licenses/>.
#include <fstream> #include <fstream>
#include <cstdint> #include <cstdint>
// Make sure boost/asio.hpp is included before windows.h.
#include <boost/asio.hpp>
#include <boost/test/unit_test.hpp> #include <boost/test/unit_test.hpp>
#include <json_spirit/json_spirit.h> #include <json_spirit/json_spirit.h>

View File

@ -20,8 +20,6 @@
*/ */
#include <functional> #include <functional>
// Make sure boost/asio.hpp is included before windows.h.
#include <boost/asio.hpp>
#include <boost/test/unit_test.hpp> #include <boost/test/unit_test.hpp>
#include <libp2p/Host.h> #include <libp2p/Host.h>
@ -44,10 +42,10 @@ BOOST_AUTO_TEST_CASE(topic)
Host host1("Test", NetworkPreferences(30303, "127.0.0.1", false, true)); Host host1("Test", NetworkPreferences(30303, "127.0.0.1", false, true));
auto whost1 = host1.registerCapability(new WhisperHost()); auto whost1 = host1.registerCapability(new WhisperHost());
host1.start(); host1.start();
while (!host1.isStarted()) while (!host1.isStarted())
this_thread::sleep_for(chrono::milliseconds(2)); this_thread::sleep_for(chrono::milliseconds(2));
bool started = false; bool started = false;
unsigned result = 0; unsigned result = 0;
std::thread listener([&]() std::thread listener([&]()
@ -75,19 +73,19 @@ BOOST_AUTO_TEST_CASE(topic)
} }
this_thread::sleep_for(chrono::milliseconds(50)); this_thread::sleep_for(chrono::milliseconds(50));
} }
}); });
Host host2("Test", NetworkPreferences(30300, "127.0.0.1", false, true)); Host host2("Test", NetworkPreferences(30300, "127.0.0.1", false, true));
auto whost2 = host2.registerCapability(new WhisperHost()); auto whost2 = host2.registerCapability(new WhisperHost());
host2.start(); host2.start();
while (!host2.isStarted()) while (!host2.isStarted())
this_thread::sleep_for(chrono::milliseconds(2)); this_thread::sleep_for(chrono::milliseconds(2));
this_thread::sleep_for(chrono::milliseconds(100)); this_thread::sleep_for(chrono::milliseconds(100));
host2.addNode(host1.id(), "127.0.0.1", 30303, 30303); host2.addNode(host1.id(), "127.0.0.1", 30303, 30303);
this_thread::sleep_for(chrono::milliseconds(500)); this_thread::sleep_for(chrono::milliseconds(500));
while (!started) while (!started)
@ -111,7 +109,7 @@ BOOST_AUTO_TEST_CASE(forwarding)
cnote << "Testing Whisper forwarding..."; cnote << "Testing Whisper forwarding...";
auto oldLogVerbosity = g_logVerbosity; auto oldLogVerbosity = g_logVerbosity;
g_logVerbosity = 0; g_logVerbosity = 0;
// Host must be configured not to share peers. // Host must be configured not to share peers.
Host host1("Listner", NetworkPreferences(30303, "", false, true)); Host host1("Listner", NetworkPreferences(30303, "", false, true));
host1.setIdealPeerCount(0); host1.setIdealPeerCount(0);
@ -119,7 +117,7 @@ BOOST_AUTO_TEST_CASE(forwarding)
host1.start(); host1.start();
while (!host1.isStarted()) while (!host1.isStarted())
this_thread::sleep_for(chrono::milliseconds(2)); this_thread::sleep_for(chrono::milliseconds(2));
unsigned result = 0; unsigned result = 0;
bool done = false; bool done = false;
@ -146,7 +144,7 @@ BOOST_AUTO_TEST_CASE(forwarding)
} }
}); });
// Host must be configured not to share peers. // Host must be configured not to share peers.
Host host2("Forwarder", NetworkPreferences(30305, "", false, true)); Host host2("Forwarder", NetworkPreferences(30305, "", false, true));
host2.setIdealPeerCount(1); host2.setIdealPeerCount(1);
@ -154,7 +152,7 @@ BOOST_AUTO_TEST_CASE(forwarding)
host2.start(); host2.start();
while (!host2.isStarted()) while (!host2.isStarted())
this_thread::sleep_for(chrono::milliseconds(2)); this_thread::sleep_for(chrono::milliseconds(2));
Public fwderid; Public fwderid;
bool startedForwarder = false; bool startedForwarder = false;
std::thread forwarder([&]() std::thread forwarder([&]()
@ -214,7 +212,7 @@ BOOST_AUTO_TEST_CASE(asyncforwarding)
unsigned result = 0; unsigned result = 0;
bool done = false; bool done = false;
// Host must be configured not to share peers. // Host must be configured not to share peers.
Host host1("Forwarder", NetworkPreferences(30305, "", false, true)); Host host1("Forwarder", NetworkPreferences(30305, "", false, true));
host1.setIdealPeerCount(1); host1.setIdealPeerCount(1);
@ -227,7 +225,7 @@ BOOST_AUTO_TEST_CASE(asyncforwarding)
std::thread forwarder([&]() std::thread forwarder([&]()
{ {
setThreadName("forwarder"); setThreadName("forwarder");
this_thread::sleep_for(chrono::milliseconds(500)); this_thread::sleep_for(chrono::milliseconds(500));
// ph.addNode("127.0.0.1", 30303, 30303); // ph.addNode("127.0.0.1", 30303, 30303);
@ -249,7 +247,7 @@ BOOST_AUTO_TEST_CASE(asyncforwarding)
while (!startedForwarder) while (!startedForwarder)
this_thread::sleep_for(chrono::milliseconds(2)); this_thread::sleep_for(chrono::milliseconds(2));
{ {
Host host2("Sender", NetworkPreferences(30300, "", false, true)); Host host2("Sender", NetworkPreferences(30300, "", false, true));
host2.setIdealPeerCount(1); host2.setIdealPeerCount(1);
@ -261,7 +259,7 @@ BOOST_AUTO_TEST_CASE(asyncforwarding)
while (!host2.peerCount()) while (!host2.peerCount())
this_thread::sleep_for(chrono::milliseconds(5)); this_thread::sleep_for(chrono::milliseconds(5));
KeyPair us = KeyPair::create(); KeyPair us = KeyPair::create();
whost2->post(us.sec(), RLPStream().append(1).out(), BuildTopic("test")); whost2->post(us.sec(), RLPStream().append(1).out(), BuildTopic("test"));
this_thread::sleep_for(chrono::milliseconds(250)); this_thread::sleep_for(chrono::milliseconds(250));