From b6b80b020006e269c877faee85f6664a1cd925a0 Mon Sep 17 00:00:00 2001 From: jhuntley Date: Wed, 21 Jan 2015 10:59:34 -0500 Subject: [PATCH] Avoid boost include order issue on windows: http://stackoverflow.com/questions/9750344/boostasio-winsock-and-winsock-2-compatibility-issue http://stackoverflow.com/questions/9750344/boostasio-winsock-and-winsock-2-compatibility-issue/16288859#16288859 Make sure boost/asio.hpp is included before windows.h. --- TestHelper.h | 1 + checkRandomTest.cpp | 1 + createRandomTest.cpp | 1 + genesis.cpp | 6 +++++- hexPrefix.cpp | 3 ++- net.cpp | 1 + rlp.cpp | 3 ++- state.cpp | 1 + trie.cpp | 3 ++- vm.cpp | 1 + vm.h | 1 + 11 files changed, 18 insertions(+), 4 deletions(-) diff --git a/TestHelper.h b/TestHelper.h index 3707a5fff..0b80273c8 100644 --- a/TestHelper.h +++ b/TestHelper.h @@ -22,6 +22,7 @@ #pragma once #include +#include #include #include "JsonSpiritHeaders.h" #include diff --git a/checkRandomTest.cpp b/checkRandomTest.cpp index e3442d438..50c3c367d 100644 --- a/checkRandomTest.cpp +++ b/checkRandomTest.cpp @@ -20,6 +20,7 @@ * Check a random test and return 0/1 for success or failure. To be used for efficiency in the random test simulation. */ +#include #include #include #include diff --git a/createRandomTest.cpp b/createRandomTest.cpp index fa5ed7bd3..da1a028bf 100644 --- a/createRandomTest.cpp +++ b/createRandomTest.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #pragma GCC diagnostic ignored "-Wunused-parameter" diff --git a/genesis.cpp b/genesis.cpp index 7ca741ee9..a450b79fc 100644 --- a/genesis.cpp +++ b/genesis.cpp @@ -22,10 +22,14 @@ #include #include + +// Make sure boost/asio.hpp is included before windows.h. +#include +#include + #include "JsonSpiritHeaders.h" #include #include -#include #include "TestHelper.h" using namespace std; diff --git a/hexPrefix.cpp b/hexPrefix.cpp index 551983db3..c96e9e98c 100644 --- a/hexPrefix.cpp +++ b/hexPrefix.cpp @@ -21,11 +21,12 @@ */ #include +#include +#include #include "JsonSpiritHeaders.h" #include #include #include -#include #include "TestHelper.h" using namespace std; diff --git a/net.cpp b/net.cpp index 5039c5436..f842ff1a3 100644 --- a/net.cpp +++ b/net.cpp @@ -19,6 +19,7 @@ * @date 2014 */ +#include #include #include #include diff --git a/rlp.cpp b/rlp.cpp index be098d84d..c67f09665 100644 --- a/rlp.cpp +++ b/rlp.cpp @@ -22,11 +22,12 @@ #include #include +#include +#include #include #include #include #include -#include #include #include "JsonSpiritHeaders.h" #include "TestHelper.h" diff --git a/state.cpp b/state.cpp index fe133822a..99fa36fc7 100644 --- a/state.cpp +++ b/state.cpp @@ -20,6 +20,7 @@ * State test functions. */ +#include #include #include #include "JsonSpiritHeaders.h" diff --git a/trie.cpp b/trie.cpp index 39a3a59a5..a15713412 100644 --- a/trie.cpp +++ b/trie.cpp @@ -22,12 +22,13 @@ #include #include +#include +#include #include "JsonSpiritHeaders.h" #include #include #include "TrieHash.h" #include "MemTrie.h" -#include #include "TestHelper.h" using namespace std; diff --git a/vm.cpp b/vm.cpp index 16f7385a0..423d55ac8 100644 --- a/vm.cpp +++ b/vm.cpp @@ -21,6 +21,7 @@ */ #include +#include #include #include #include diff --git a/vm.h b/vm.h index 0a5b5fb45..ae28213bd 100644 --- a/vm.h +++ b/vm.h @@ -25,6 +25,7 @@ along with cpp-ethereum. If not, see . #include #include +#include #include #include #include