Regex: move boost headers to top of list to work around clang issue which requires workarounds present in config.hpp.

This commit is contained in:
jzmaddock
2017-09-21 17:15:51 +01:00
parent 09894a5e21
commit 289ce86488
26 changed files with 33 additions and 31 deletions

View File

@ -9,11 +9,11 @@
* *
*/ */
#include <boost/regex.hpp>
#include <iostream> #include <iostream>
#include <fstream> #include <fstream>
#include <string> #include <string>
#include <vector> #include <vector>
#include <boost/regex.hpp>
#ifdef BOOST_MSVC #ifdef BOOST_MSVC
#pragma warning(disable:4512 4244) #pragma warning(disable:4512 4244)

View File

@ -16,8 +16,8 @@
* DESCRIPTION: Credit card number formatting code. * DESCRIPTION: Credit card number formatting code.
*/ */
#include <string>
#include <boost/regex.hpp> #include <boost/regex.hpp>
#include <string>
bool validate_card_format(const std::string& s) bool validate_card_format(const std::string& s)
{ {

View File

@ -16,12 +16,12 @@
* DESCRIPTION: Search example using partial matches. * DESCRIPTION: Search example using partial matches.
*/ */
#include <boost/regex.hpp>
#include <iostream> #include <iostream>
#include <fstream> #include <fstream>
#include <sstream> #include <sstream>
#include <string> #include <string>
#include <cstring> #include <cstring>
#include <boost/regex.hpp>
#ifdef BOOST_NO_STDC_NAMESPACE #ifdef BOOST_NO_STDC_NAMESPACE
namespace std{ using ::memmove; } namespace std{ using ::memmove; }

View File

@ -16,12 +16,12 @@
* DESCRIPTION: Search example using partial matches. * DESCRIPTION: Search example using partial matches.
*/ */
#include <boost/regex.hpp>
#include <iostream> #include <iostream>
#include <fstream> #include <fstream>
#include <sstream> #include <sstream>
#include <string> #include <string>
#include <cstring> #include <cstring>
#include <boost/regex.hpp>
#ifdef BOOST_NO_STDC_NAMESPACE #ifdef BOOST_NO_STDC_NAMESPACE
namespace std{ using ::memmove; } namespace std{ using ::memmove; }

View File

@ -16,9 +16,9 @@
* DESCRIPTION: regex_match example using partial matches. * DESCRIPTION: regex_match example using partial matches.
*/ */
#include <boost/regex.hpp>
#include <string> #include <string>
#include <iostream> #include <iostream>
#include <boost/regex.hpp>
boost::regex e("(\\d{3,4})[- ]?(\\d{4})[- ]?(\\d{4})[- ]?(\\d{4})"); boost::regex e("(\\d{3,4})[- ]?(\\d{4})[- ]?(\\d{4})[- ]?(\\d{4})");

View File

@ -16,9 +16,9 @@
* DESCRIPTION: regex_grep example 1: searches a cpp file for class definitions. * DESCRIPTION: regex_grep example 1: searches a cpp file for class definitions.
*/ */
#include <boost/regex.hpp>
#include <string> #include <string>
#include <map> #include <map>
#include <boost/regex.hpp>
// purpose: // purpose:
// takes the contents of a file in the form of a string // takes the contents of a file in the form of a string

View File

@ -17,6 +17,7 @@
* using a global callback function. * using a global callback function.
*/ */
#include <boost/regex.hpp>
#include <string> #include <string>
#include <map> #include <map>
#include <boost/regex.hpp> #include <boost/regex.hpp>

View File

@ -17,9 +17,9 @@
* using a bound member function callback. * using a bound member function callback.
*/ */
#include <boost/regex.hpp>
#include <string> #include <string>
#include <map> #include <map>
#include <boost/regex.hpp>
#include <functional> #include <functional>
#include <boost/detail/workaround.hpp> #include <boost/detail/workaround.hpp>

View File

@ -19,9 +19,9 @@
#ifdef __BORLANDC__ #ifdef __BORLANDC__
#include <boost/regex.hpp>
#include <string> #include <string>
#include <map> #include <map>
#include <boost/regex.hpp>
#include <functional> #include <functional>
// purpose: // purpose:

View File

@ -17,11 +17,11 @@
* using global data. * using global data.
*/ */
#include <boost/regex.hpp>
#include <string> #include <string>
#include <map> #include <map>
#include <fstream> #include <fstream>
#include <iostream> #include <iostream>
#include <boost/regex.hpp>
using namespace std; using namespace std;

View File

@ -16,9 +16,9 @@
* DESCRIPTION: ftp based regex_match example. * DESCRIPTION: ftp based regex_match example.
*/ */
#include <boost/regex.hpp>
#include <cstdlib> #include <cstdlib>
#include <stdlib.h> #include <stdlib.h>
#include <boost/regex.hpp>
#include <string> #include <string>
#include <iostream> #include <iostream>

View File

@ -17,12 +17,12 @@
* converts a C++ file to syntax highlighted HTML. * converts a C++ file to syntax highlighted HTML.
*/ */
#include <boost/regex.hpp>
#include <iostream> #include <iostream>
#include <fstream> #include <fstream>
#include <sstream> #include <sstream>
#include <string> #include <string>
#include <iterator> #include <iterator>
#include <boost/regex.hpp>
#include <fstream> #include <fstream>
#include <iostream> #include <iostream>

View File

@ -17,12 +17,12 @@
* converts a C++ file to syntax highlighted HTML. * converts a C++ file to syntax highlighted HTML.
*/ */
#include <boost/regex.hpp>
#include <iostream> #include <iostream>
#include <fstream> #include <fstream>
#include <sstream> #include <sstream>
#include <string> #include <string>
#include <iterator> #include <iterator>
#include <boost/regex.hpp>
#include <fstream> #include <fstream>
#include <iostream> #include <iostream>

View File

@ -16,9 +16,9 @@
* DESCRIPTION: regex_search example: searches a cpp file for class definitions. * DESCRIPTION: regex_search example: searches a cpp file for class definitions.
*/ */
#include <boost/regex.hpp>
#include <string> #include <string>
#include <map> #include <map>
#include <boost/regex.hpp>
// purpose: // purpose:
// takes the contents of a file in the form of a string // takes the contents of a file in the form of a string

View File

@ -17,8 +17,8 @@
*/ */
#include <list>
#include <boost/regex.hpp> #include <boost/regex.hpp>
#include <list>
unsigned tokenise(std::list<std::string>& l, std::string& s) unsigned tokenise(std::list<std::string>& l, std::string& s)

View File

@ -17,11 +17,11 @@
*/ */
#include <boost/regex.hpp>
#include <list> #include <list>
#include <fstream> #include <fstream>
#include <iostream> #include <iostream>
#include <iterator> #include <iterator>
#include <boost/regex.hpp>
boost::regex e("<\\s*A\\s+[^>]*href\\s*=\\s*\"([^\"]*)\"", boost::regex e("<\\s*A\\s+[^>]*href\\s*=\\s*\"([^\"]*)\"",
boost::regex::normal | boost::regbase::icase); boost::regex::normal | boost::regbase::icase);

View File

@ -17,10 +17,10 @@
*/ */
#include <boost/regex.hpp>
#include <fstream> #include <fstream>
#include <iostream> #include <iostream>
#include <iterator> #include <iterator>
#include <boost/regex.hpp>
boost::regex e("<\\s*A\\s+[^>]*href\\s*=\\s*\"([^\"]*)\"", boost::regex e("<\\s*A\\s+[^>]*href\\s*=\\s*\"([^\"]*)\"",
boost::regex::normal | boost::regbase::icase); boost::regex::normal | boost::regbase::icase);

View File

@ -13,6 +13,12 @@
#pragma warning(disable: 4996 4127) #pragma warning(disable: 4996 4127)
#endif #endif
#include <boost/config.hpp>
#include <boost/regex.hpp>
#include <boost/cregex.hpp>
#include <boost/timer.hpp>
#include <boost/smart_ptr.hpp>
#include <string> #include <string>
#include <algorithm> #include <algorithm>
#include <deque> #include <deque>
@ -35,12 +41,6 @@ using std::streambuf;
using std::getline; using std::getline;
#endif #endif
#include <boost/config.hpp>
#include <boost/regex.hpp>
#include <boost/cregex.hpp>
#include <boost/timer.hpp>
#include <boost/smart_ptr.hpp>
#if defined(_WIN32) && defined(BOOST_REGEX_USE_WIN32_LOCALE) #if defined(_WIN32) && defined(BOOST_REGEX_USE_WIN32_LOCALE)
#include <windows.h> #include <windows.h>
#endif #endif

View File

@ -19,6 +19,7 @@
#ifndef BOOST_REGEX_ICU_HPP #ifndef BOOST_REGEX_ICU_HPP
#define BOOST_REGEX_ICU_HPP #define BOOST_REGEX_ICU_HPP
#include <boost/config.hpp>
#include <unicode/utypes.h> #include <unicode/utypes.h>
#include <unicode/uchar.h> #include <unicode/uchar.h>
#include <unicode/coll.h> #include <unicode/coll.h>

View File

@ -19,12 +19,12 @@
#ifndef BOOST_REGEX_OBJECT_CACHE_HPP #ifndef BOOST_REGEX_OBJECT_CACHE_HPP
#define BOOST_REGEX_OBJECT_CACHE_HPP #define BOOST_REGEX_OBJECT_CACHE_HPP
#include <boost/config.hpp>
#include <boost/shared_ptr.hpp>
#include <map> #include <map>
#include <list> #include <list>
#include <stdexcept> #include <stdexcept>
#include <string> #include <string>
#include <boost/config.hpp>
#include <boost/shared_ptr.hpp>
#ifdef BOOST_HAS_THREADS #ifdef BOOST_HAS_THREADS
#include <boost/regex/pending/static_mutex.hpp> #include <boost/regex/pending/static_mutex.hpp>
#endif #endif

View File

@ -19,7 +19,7 @@
#ifndef BOOST_REGEX_WORKAROUND_HPP #ifndef BOOST_REGEX_WORKAROUND_HPP
#define BOOST_REGEX_WORKAROUND_HPP #define BOOST_REGEX_WORKAROUND_HPP
#include <boost/config.hpp>
#include <new> #include <new>
#include <cstring> #include <cstring>
#include <cstdlib> #include <cstdlib>

View File

@ -20,11 +20,11 @@
#define UNICODE #define UNICODE
#define _UNICODE #define _UNICODE
#include <boost/regex.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <assert.h> #include <assert.h>
#include <stdlib.h> #include <stdlib.h>
#include <boost/regex.h>
#ifndef BOOST_NO_WREGEX #ifndef BOOST_NO_WREGEX
#include <wchar.h> #include <wchar.h>

View File

@ -16,10 +16,10 @@
* DESCRIPTION: Test for indefinite recursion and/or stack overrun. * DESCRIPTION: Test for indefinite recursion and/or stack overrun.
*/ */
#include <string>
#include <boost/regex.hpp> #include <boost/regex.hpp>
#include <boost/detail/lightweight_main.hpp> #include <boost/detail/lightweight_main.hpp>
#include "../test_macros.hpp" #include "../test_macros.hpp"
#include <string>
#ifdef BOOST_INTEL #ifdef BOOST_INTEL
#pragma warning(disable:1418 981 983 383) #pragma warning(disable:1418 981 983 383)

View File

@ -16,10 +16,10 @@
* DESCRIPTION: Test for indefinite recursion and/or stack overrun. * DESCRIPTION: Test for indefinite recursion and/or stack overrun.
*/ */
#include <string>
#include <boost/regex.hpp> #include <boost/regex.hpp>
#include <boost/detail/lightweight_main.hpp> #include <boost/detail/lightweight_main.hpp>
#include "../test_macros.hpp" #include "../test_macros.hpp"
#include <string>
#ifdef BOOST_INTEL #ifdef BOOST_INTEL
#pragma warning(disable:1418 981 983 383) #pragma warning(disable:1418 981 983 383)

View File

@ -16,11 +16,11 @@
* DESCRIPTION: test program for boost::static_mutex. * DESCRIPTION: test program for boost::static_mutex.
*/ */
#include <iostream>
#include <iomanip>
#include <boost/regex/pending/static_mutex.hpp> #include <boost/regex/pending/static_mutex.hpp>
#include <boost/thread/thread.hpp> #include <boost/thread/thread.hpp>
#include <boost/timer.hpp> #include <boost/timer.hpp>
#include <iostream>
#include <iomanip>
// //
// we cannot use the regular Boost.Test in here: it is not thread safe // we cannot use the regular Boost.Test in here: it is not thread safe

View File

@ -17,13 +17,13 @@
* paste into regex source. * paste into regex source.
*/ */
#include <boost/config.hpp>
#include <map> #include <map>
#include <vector> #include <vector>
#include <string> #include <string>
#include <iostream> #include <iostream>
#include <algorithm> #include <algorithm>
#include <cctype> #include <cctype>
#include <boost/config.hpp>
std::string g_char_type; std::string g_char_type;
std::string g_data_type; std::string g_data_type;