From 289ce864881d2a18f8bdfb0992909ecdee8c20b2 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Thu, 21 Sep 2017 17:15:51 +0100 Subject: [PATCH] Regex: move boost headers to top of list to work around clang issue which requires workarounds present in config.hpp. --- example/grep/grep.cpp | 2 +- example/snippets/credit_card_example.cpp | 2 +- example/snippets/partial_regex_grep.cpp | 2 +- example/snippets/partial_regex_iterate.cpp | 2 +- example/snippets/partial_regex_match.cpp | 2 +- example/snippets/regex_grep_example_1.cpp | 2 +- example/snippets/regex_grep_example_2.cpp | 1 + example/snippets/regex_grep_example_3.cpp | 2 +- example/snippets/regex_grep_example_4.cpp | 2 +- example/snippets/regex_iterator_example.cpp | 2 +- example/snippets/regex_match_example.cpp | 2 +- example/snippets/regex_merge_example.cpp | 2 +- example/snippets/regex_replace_example.cpp | 2 +- example/snippets/regex_search_example.cpp | 2 +- example/snippets/regex_split_example_1.cpp | 2 +- example/snippets/regex_split_example_2.cpp | 2 +- example/snippets/regex_token_iterator_eg_2.cpp | 2 +- example/timer/regex_timer.cpp | 12 ++++++------ include/boost/regex/icu.hpp | 1 + include/boost/regex/pending/object_cache.hpp | 4 ++-- include/boost/regex/v4/regex_workaround.hpp | 2 +- test/c_compiler_checks/wide_posix_api_check.c | 2 +- test/pathology/bad_expression_test.cpp | 2 +- test/pathology/recursion_test.cpp | 2 +- test/static_mutex/static_mutex_test.cpp | 4 ++-- tools/generate/tables.cpp | 2 +- 26 files changed, 33 insertions(+), 31 deletions(-) diff --git a/example/grep/grep.cpp b/example/grep/grep.cpp index f2becf12..5c212ea6 100644 --- a/example/grep/grep.cpp +++ b/example/grep/grep.cpp @@ -9,11 +9,11 @@ * */ +#include #include #include #include #include -#include #ifdef BOOST_MSVC #pragma warning(disable:4512 4244) diff --git a/example/snippets/credit_card_example.cpp b/example/snippets/credit_card_example.cpp index cb7f8d52..1620d8cc 100644 --- a/example/snippets/credit_card_example.cpp +++ b/example/snippets/credit_card_example.cpp @@ -16,8 +16,8 @@ * DESCRIPTION: Credit card number formatting code. */ -#include #include +#include bool validate_card_format(const std::string& s) { diff --git a/example/snippets/partial_regex_grep.cpp b/example/snippets/partial_regex_grep.cpp index 5d1fca07..9934ebc5 100644 --- a/example/snippets/partial_regex_grep.cpp +++ b/example/snippets/partial_regex_grep.cpp @@ -16,12 +16,12 @@ * DESCRIPTION: Search example using partial matches. */ +#include #include #include #include #include #include -#include #ifdef BOOST_NO_STDC_NAMESPACE namespace std{ using ::memmove; } diff --git a/example/snippets/partial_regex_iterate.cpp b/example/snippets/partial_regex_iterate.cpp index 065438ab..62f67dd2 100644 --- a/example/snippets/partial_regex_iterate.cpp +++ b/example/snippets/partial_regex_iterate.cpp @@ -16,12 +16,12 @@ * DESCRIPTION: Search example using partial matches. */ +#include #include #include #include #include #include -#include #ifdef BOOST_NO_STDC_NAMESPACE namespace std{ using ::memmove; } diff --git a/example/snippets/partial_regex_match.cpp b/example/snippets/partial_regex_match.cpp index 36d23144..096072bf 100644 --- a/example/snippets/partial_regex_match.cpp +++ b/example/snippets/partial_regex_match.cpp @@ -16,9 +16,9 @@ * DESCRIPTION: regex_match example using partial matches. */ +#include #include #include -#include boost::regex e("(\\d{3,4})[- ]?(\\d{4})[- ]?(\\d{4})[- ]?(\\d{4})"); diff --git a/example/snippets/regex_grep_example_1.cpp b/example/snippets/regex_grep_example_1.cpp index e0f3f3e8..2878f578 100644 --- a/example/snippets/regex_grep_example_1.cpp +++ b/example/snippets/regex_grep_example_1.cpp @@ -16,9 +16,9 @@ * DESCRIPTION: regex_grep example 1: searches a cpp file for class definitions. */ +#include #include #include -#include // purpose: // takes the contents of a file in the form of a string diff --git a/example/snippets/regex_grep_example_2.cpp b/example/snippets/regex_grep_example_2.cpp index f012e566..b5222c2d 100644 --- a/example/snippets/regex_grep_example_2.cpp +++ b/example/snippets/regex_grep_example_2.cpp @@ -17,6 +17,7 @@ * using a global callback function. */ +#include #include #include #include diff --git a/example/snippets/regex_grep_example_3.cpp b/example/snippets/regex_grep_example_3.cpp index 5bb3fd0a..9097dfda 100644 --- a/example/snippets/regex_grep_example_3.cpp +++ b/example/snippets/regex_grep_example_3.cpp @@ -17,9 +17,9 @@ * using a bound member function callback. */ +#include #include #include -#include #include #include diff --git a/example/snippets/regex_grep_example_4.cpp b/example/snippets/regex_grep_example_4.cpp index 5217f1c1..533d896e 100644 --- a/example/snippets/regex_grep_example_4.cpp +++ b/example/snippets/regex_grep_example_4.cpp @@ -19,9 +19,9 @@ #ifdef __BORLANDC__ +#include #include #include -#include #include // purpose: diff --git a/example/snippets/regex_iterator_example.cpp b/example/snippets/regex_iterator_example.cpp index 3fe1420d..101052f1 100644 --- a/example/snippets/regex_iterator_example.cpp +++ b/example/snippets/regex_iterator_example.cpp @@ -17,11 +17,11 @@ * using global data. */ +#include #include #include #include #include -#include using namespace std; diff --git a/example/snippets/regex_match_example.cpp b/example/snippets/regex_match_example.cpp index f714f94b..dd10de4d 100644 --- a/example/snippets/regex_match_example.cpp +++ b/example/snippets/regex_match_example.cpp @@ -16,9 +16,9 @@ * DESCRIPTION: ftp based regex_match example. */ +#include #include #include -#include #include #include diff --git a/example/snippets/regex_merge_example.cpp b/example/snippets/regex_merge_example.cpp index fcc4f5f7..cb8b493c 100644 --- a/example/snippets/regex_merge_example.cpp +++ b/example/snippets/regex_merge_example.cpp @@ -17,12 +17,12 @@ * converts a C++ file to syntax highlighted HTML. */ +#include #include #include #include #include #include -#include #include #include diff --git a/example/snippets/regex_replace_example.cpp b/example/snippets/regex_replace_example.cpp index 3120453c..19331ab8 100644 --- a/example/snippets/regex_replace_example.cpp +++ b/example/snippets/regex_replace_example.cpp @@ -17,12 +17,12 @@ * converts a C++ file to syntax highlighted HTML. */ +#include #include #include #include #include #include -#include #include #include diff --git a/example/snippets/regex_search_example.cpp b/example/snippets/regex_search_example.cpp index 761a11b2..ee9cd90f 100644 --- a/example/snippets/regex_search_example.cpp +++ b/example/snippets/regex_search_example.cpp @@ -16,9 +16,9 @@ * DESCRIPTION: regex_search example: searches a cpp file for class definitions. */ +#include #include #include -#include // purpose: // takes the contents of a file in the form of a string diff --git a/example/snippets/regex_split_example_1.cpp b/example/snippets/regex_split_example_1.cpp index 4db5bdd0..df2ef96b 100644 --- a/example/snippets/regex_split_example_1.cpp +++ b/example/snippets/regex_split_example_1.cpp @@ -17,8 +17,8 @@ */ -#include #include +#include unsigned tokenise(std::list& l, std::string& s) diff --git a/example/snippets/regex_split_example_2.cpp b/example/snippets/regex_split_example_2.cpp index 205e588c..ad735022 100644 --- a/example/snippets/regex_split_example_2.cpp +++ b/example/snippets/regex_split_example_2.cpp @@ -17,11 +17,11 @@ */ +#include #include #include #include #include -#include boost::regex e("<\\s*A\\s+[^>]*href\\s*=\\s*\"([^\"]*)\"", boost::regex::normal | boost::regbase::icase); diff --git a/example/snippets/regex_token_iterator_eg_2.cpp b/example/snippets/regex_token_iterator_eg_2.cpp index e3e43de9..3458ce4d 100644 --- a/example/snippets/regex_token_iterator_eg_2.cpp +++ b/example/snippets/regex_token_iterator_eg_2.cpp @@ -17,10 +17,10 @@ */ +#include #include #include #include -#include boost::regex e("<\\s*A\\s+[^>]*href\\s*=\\s*\"([^\"]*)\"", boost::regex::normal | boost::regbase::icase); diff --git a/example/timer/regex_timer.cpp b/example/timer/regex_timer.cpp index 630eddd2..a6924237 100644 --- a/example/timer/regex_timer.cpp +++ b/example/timer/regex_timer.cpp @@ -13,6 +13,12 @@ #pragma warning(disable: 4996 4127) #endif +#include +#include +#include +#include +#include + #include #include #include @@ -35,12 +41,6 @@ using std::streambuf; using std::getline; #endif -#include -#include -#include -#include -#include - #if defined(_WIN32) && defined(BOOST_REGEX_USE_WIN32_LOCALE) #include #endif diff --git a/include/boost/regex/icu.hpp b/include/boost/regex/icu.hpp index f1ca99c9..cdae1c8b 100644 --- a/include/boost/regex/icu.hpp +++ b/include/boost/regex/icu.hpp @@ -19,6 +19,7 @@ #ifndef BOOST_REGEX_ICU_HPP #define BOOST_REGEX_ICU_HPP +#include #include #include #include diff --git a/include/boost/regex/pending/object_cache.hpp b/include/boost/regex/pending/object_cache.hpp index d47fbba9..c47862f0 100644 --- a/include/boost/regex/pending/object_cache.hpp +++ b/include/boost/regex/pending/object_cache.hpp @@ -19,12 +19,12 @@ #ifndef BOOST_REGEX_OBJECT_CACHE_HPP #define BOOST_REGEX_OBJECT_CACHE_HPP +#include +#include #include #include #include #include -#include -#include #ifdef BOOST_HAS_THREADS #include #endif diff --git a/include/boost/regex/v4/regex_workaround.hpp b/include/boost/regex/v4/regex_workaround.hpp index f900720b..f245f90d 100644 --- a/include/boost/regex/v4/regex_workaround.hpp +++ b/include/boost/regex/v4/regex_workaround.hpp @@ -19,7 +19,7 @@ #ifndef BOOST_REGEX_WORKAROUND_HPP #define BOOST_REGEX_WORKAROUND_HPP - +#include #include #include #include diff --git a/test/c_compiler_checks/wide_posix_api_check.c b/test/c_compiler_checks/wide_posix_api_check.c index c9ab85bb..096d929a 100644 --- a/test/c_compiler_checks/wide_posix_api_check.c +++ b/test/c_compiler_checks/wide_posix_api_check.c @@ -20,11 +20,11 @@ #define UNICODE #define _UNICODE +#include #include #include #include #include -#include #ifndef BOOST_NO_WREGEX #include diff --git a/test/pathology/bad_expression_test.cpp b/test/pathology/bad_expression_test.cpp index bba20cda..6e701539 100644 --- a/test/pathology/bad_expression_test.cpp +++ b/test/pathology/bad_expression_test.cpp @@ -16,10 +16,10 @@ * DESCRIPTION: Test for indefinite recursion and/or stack overrun. */ -#include #include #include #include "../test_macros.hpp" +#include #ifdef BOOST_INTEL #pragma warning(disable:1418 981 983 383) diff --git a/test/pathology/recursion_test.cpp b/test/pathology/recursion_test.cpp index 46b86f41..c0438e6e 100644 --- a/test/pathology/recursion_test.cpp +++ b/test/pathology/recursion_test.cpp @@ -16,10 +16,10 @@ * DESCRIPTION: Test for indefinite recursion and/or stack overrun. */ -#include #include #include #include "../test_macros.hpp" +#include #ifdef BOOST_INTEL #pragma warning(disable:1418 981 983 383) diff --git a/test/static_mutex/static_mutex_test.cpp b/test/static_mutex/static_mutex_test.cpp index 871a1d90..f029a4be 100644 --- a/test/static_mutex/static_mutex_test.cpp +++ b/test/static_mutex/static_mutex_test.cpp @@ -16,11 +16,11 @@ * DESCRIPTION: test program for boost::static_mutex. */ -#include -#include #include #include #include +#include +#include // // we cannot use the regular Boost.Test in here: it is not thread safe diff --git a/tools/generate/tables.cpp b/tools/generate/tables.cpp index 34d1f9f7..dae31de0 100644 --- a/tools/generate/tables.cpp +++ b/tools/generate/tables.cpp @@ -17,13 +17,13 @@ * paste into regex source. */ +#include #include #include #include #include #include #include -#include std::string g_char_type; std::string g_data_type;