Skip to content

Commit 289ce86

Browse files
committed
Regex: move boost headers to top of list to work around clang issue which requires workarounds present in config.hpp.
1 parent 09894a5 commit 289ce86

26 files changed

+33
-31
lines changed

example/grep/grep.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
*
1010
*/
1111

12+
#include <boost/regex.hpp>
1213
#include <iostream>
1314
#include <fstream>
1415
#include <string>
1516
#include <vector>
16-
#include <boost/regex.hpp>
1717

1818
#ifdef BOOST_MSVC
1919
#pragma warning(disable:4512 4244)

example/snippets/credit_card_example.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
* DESCRIPTION: Credit card number formatting code.
1717
*/
1818

19-
#include <string>
2019
#include <boost/regex.hpp>
20+
#include <string>
2121

2222
bool validate_card_format(const std::string& s)
2323
{

example/snippets/partial_regex_grep.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
* DESCRIPTION: Search example using partial matches.
1717
*/
1818

19+
#include <boost/regex.hpp>
1920
#include <iostream>
2021
#include <fstream>
2122
#include <sstream>
2223
#include <string>
2324
#include <cstring>
24-
#include <boost/regex.hpp>
2525

2626
#ifdef BOOST_NO_STDC_NAMESPACE
2727
namespace std{ using ::memmove; }

example/snippets/partial_regex_iterate.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
* DESCRIPTION: Search example using partial matches.
1717
*/
1818

19+
#include <boost/regex.hpp>
1920
#include <iostream>
2021
#include <fstream>
2122
#include <sstream>
2223
#include <string>
2324
#include <cstring>
24-
#include <boost/regex.hpp>
2525

2626
#ifdef BOOST_NO_STDC_NAMESPACE
2727
namespace std{ using ::memmove; }

example/snippets/partial_regex_match.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
* DESCRIPTION: regex_match example using partial matches.
1717
*/
1818

19+
#include <boost/regex.hpp>
1920
#include <string>
2021
#include <iostream>
21-
#include <boost/regex.hpp>
2222

2323
boost::regex e("(\\d{3,4})[- ]?(\\d{4})[- ]?(\\d{4})[- ]?(\\d{4})");
2424

example/snippets/regex_grep_example_1.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
* DESCRIPTION: regex_grep example 1: searches a cpp file for class definitions.
1717
*/
1818

19+
#include <boost/regex.hpp>
1920
#include <string>
2021
#include <map>
21-
#include <boost/regex.hpp>
2222

2323
// purpose:
2424
// takes the contents of a file in the form of a string

example/snippets/regex_grep_example_2.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
* using a global callback function.
1818
*/
1919

20+
#include <boost/regex.hpp>
2021
#include <string>
2122
#include <map>
2223
#include <boost/regex.hpp>

example/snippets/regex_grep_example_3.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
* using a bound member function callback.
1818
*/
1919

20+
#include <boost/regex.hpp>
2021
#include <string>
2122
#include <map>
22-
#include <boost/regex.hpp>
2323
#include <functional>
2424
#include <boost/detail/workaround.hpp>
2525

example/snippets/regex_grep_example_4.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919

2020
#ifdef __BORLANDC__
2121

22+
#include <boost/regex.hpp>
2223
#include <string>
2324
#include <map>
24-
#include <boost/regex.hpp>
2525
#include <functional>
2626

2727
// purpose:

example/snippets/regex_iterator_example.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
* using global data.
1818
*/
1919

20+
#include <boost/regex.hpp>
2021
#include <string>
2122
#include <map>
2223
#include <fstream>
2324
#include <iostream>
24-
#include <boost/regex.hpp>
2525

2626
using namespace std;
2727

example/snippets/regex_match_example.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
* DESCRIPTION: ftp based regex_match example.
1717
*/
1818

19+
#include <boost/regex.hpp>
1920
#include <cstdlib>
2021
#include <stdlib.h>
21-
#include <boost/regex.hpp>
2222
#include <string>
2323
#include <iostream>
2424

example/snippets/regex_merge_example.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717
* converts a C++ file to syntax highlighted HTML.
1818
*/
1919

20+
#include <boost/regex.hpp>
2021
#include <iostream>
2122
#include <fstream>
2223
#include <sstream>
2324
#include <string>
2425
#include <iterator>
25-
#include <boost/regex.hpp>
2626
#include <fstream>
2727
#include <iostream>
2828

example/snippets/regex_replace_example.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717
* converts a C++ file to syntax highlighted HTML.
1818
*/
1919

20+
#include <boost/regex.hpp>
2021
#include <iostream>
2122
#include <fstream>
2223
#include <sstream>
2324
#include <string>
2425
#include <iterator>
25-
#include <boost/regex.hpp>
2626
#include <fstream>
2727
#include <iostream>
2828

example/snippets/regex_search_example.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
* DESCRIPTION: regex_search example: searches a cpp file for class definitions.
1717
*/
1818

19+
#include <boost/regex.hpp>
1920
#include <string>
2021
#include <map>
21-
#include <boost/regex.hpp>
2222

2323
// purpose:
2424
// takes the contents of a file in the form of a string

example/snippets/regex_split_example_1.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
*/
1818

1919

20-
#include <list>
2120
#include <boost/regex.hpp>
21+
#include <list>
2222

2323

2424
unsigned tokenise(std::list<std::string>& l, std::string& s)

example/snippets/regex_split_example_2.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
*/
1818

1919

20+
#include <boost/regex.hpp>
2021
#include <list>
2122
#include <fstream>
2223
#include <iostream>
2324
#include <iterator>
24-
#include <boost/regex.hpp>
2525

2626
boost::regex e("<\\s*A\\s+[^>]*href\\s*=\\s*\"([^\"]*)\"",
2727
boost::regex::normal | boost::regbase::icase);

example/snippets/regex_token_iterator_eg_2.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
*/
1818

1919

20+
#include <boost/regex.hpp>
2021
#include <fstream>
2122
#include <iostream>
2223
#include <iterator>
23-
#include <boost/regex.hpp>
2424

2525
boost::regex e("<\\s*A\\s+[^>]*href\\s*=\\s*\"([^\"]*)\"",
2626
boost::regex::normal | boost::regbase::icase);

example/timer/regex_timer.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
#pragma warning(disable: 4996 4127)
1414
#endif
1515

16+
#include <boost/config.hpp>
17+
#include <boost/regex.hpp>
18+
#include <boost/cregex.hpp>
19+
#include <boost/timer.hpp>
20+
#include <boost/smart_ptr.hpp>
21+
1622
#include <string>
1723
#include <algorithm>
1824
#include <deque>
@@ -35,12 +41,6 @@ using std::streambuf;
3541
using std::getline;
3642
#endif
3743

38-
#include <boost/config.hpp>
39-
#include <boost/regex.hpp>
40-
#include <boost/cregex.hpp>
41-
#include <boost/timer.hpp>
42-
#include <boost/smart_ptr.hpp>
43-
4444
#if defined(_WIN32) && defined(BOOST_REGEX_USE_WIN32_LOCALE)
4545
#include <windows.h>
4646
#endif

include/boost/regex/icu.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#ifndef BOOST_REGEX_ICU_HPP
2020
#define BOOST_REGEX_ICU_HPP
2121

22+
#include <boost/config.hpp>
2223
#include <unicode/utypes.h>
2324
#include <unicode/uchar.h>
2425
#include <unicode/coll.h>

include/boost/regex/pending/object_cache.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919
#ifndef BOOST_REGEX_OBJECT_CACHE_HPP
2020
#define BOOST_REGEX_OBJECT_CACHE_HPP
2121

22+
#include <boost/config.hpp>
23+
#include <boost/shared_ptr.hpp>
2224
#include <map>
2325
#include <list>
2426
#include <stdexcept>
2527
#include <string>
26-
#include <boost/config.hpp>
27-
#include <boost/shared_ptr.hpp>
2828
#ifdef BOOST_HAS_THREADS
2929
#include <boost/regex/pending/static_mutex.hpp>
3030
#endif

include/boost/regex/v4/regex_workaround.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#ifndef BOOST_REGEX_WORKAROUND_HPP
2020
#define BOOST_REGEX_WORKAROUND_HPP
2121

22-
22+
#include <boost/config.hpp>
2323
#include <new>
2424
#include <cstring>
2525
#include <cstdlib>

test/c_compiler_checks/wide_posix_api_check.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020
#define UNICODE
2121
#define _UNICODE
2222

23+
#include <boost/regex.h>
2324
#include <stdio.h>
2425
#include <string.h>
2526
#include <assert.h>
2627
#include <stdlib.h>
27-
#include <boost/regex.h>
2828

2929
#ifndef BOOST_NO_WREGEX
3030
#include <wchar.h>

test/pathology/bad_expression_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
* DESCRIPTION: Test for indefinite recursion and/or stack overrun.
1717
*/
1818

19-
#include <string>
2019
#include <boost/regex.hpp>
2120
#include <boost/detail/lightweight_main.hpp>
2221
#include "../test_macros.hpp"
22+
#include <string>
2323

2424
#ifdef BOOST_INTEL
2525
#pragma warning(disable:1418 981 983 383)

test/pathology/recursion_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
* DESCRIPTION: Test for indefinite recursion and/or stack overrun.
1717
*/
1818

19-
#include <string>
2019
#include <boost/regex.hpp>
2120
#include <boost/detail/lightweight_main.hpp>
2221
#include "../test_macros.hpp"
22+
#include <string>
2323

2424
#ifdef BOOST_INTEL
2525
#pragma warning(disable:1418 981 983 383)

test/static_mutex/static_mutex_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
* DESCRIPTION: test program for boost::static_mutex.
1717
*/
1818

19-
#include <iostream>
20-
#include <iomanip>
2119
#include <boost/regex/pending/static_mutex.hpp>
2220
#include <boost/thread/thread.hpp>
2321
#include <boost/timer.hpp>
22+
#include <iostream>
23+
#include <iomanip>
2424

2525
//
2626
// we cannot use the regular Boost.Test in here: it is not thread safe

tools/generate/tables.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717
* paste into regex source.
1818
*/
1919

20+
#include <boost/config.hpp>
2021
#include <map>
2122
#include <vector>
2223
#include <string>
2324
#include <iostream>
2425
#include <algorithm>
2526
#include <cctype>
26-
#include <boost/config.hpp>
2727

2828
std::string g_char_type;
2929
std::string g_data_type;

0 commit comments

Comments
 (0)