Compare commits

...

29 Commits

Author SHA1 Message Date
91892ab07d On the xcode6.4 image, git is an older version and doesn't support --jobs 3 2020-01-20 18:51:31 +02:00
bb9c3b68d4 Add -I example to depinst 2020-01-20 16:58:24 +02:00
4788894218 Use --jobs 3 when updating submodules 2020-01-20 16:56:43 +02:00
b0eb5ccb20 Use depinst 2020-01-20 16:48:44 +02:00
a1d0c4fdc4 Update .travis.yml 2020-01-20 16:43:43 +02:00
12fd320f3c Fix CMakeLists.txt 2020-01-20 16:40:28 +02:00
3b98dc901a Change ICU configuration to support cross-compiling.
Fixes: https://github.com/boostorg/regex/issues/78
2020-01-19 18:16:37 +00:00
b5d60694cc Merge pull request #91 from rdoeffinger/staticptrfix
Avoid generating pointers in writeable data section.
2020-01-07 19:00:52 +00:00
082437d4fd Merge branch 'develop' into staticptrfix 2020-01-07 19:00:38 +00:00
aacd14bf71 Merge pull request #93 from rdoeffinger/makestatic
regex_traits_defaults: Do not export arrays only used in same compila…
2020-01-07 18:56:05 +00:00
a3814a31e9 Merge pull request #92 from rdoeffinger/spellingfix
Minor spelling fix.
2020-01-07 18:54:30 +00:00
6d00984aa9 Merge pull request #79 from stac47/fix_deprecated_copy
Fix gcc -Wdeprecated-copy
2020-01-07 18:54:04 +00:00
edcbf059d7 Merge pull request #90 from Bagira80/patch-1
Point for issues to Github instead of old Trac.
2020-01-07 18:48:36 +00:00
f63c602e6a Merge pull request #86 from Mike-Devel/min_cmake
[CMake] Add minimal cmake support
2020-01-07 18:47:46 +00:00
92f6a803a5 [CMake/CI] Also test build as shared library on travis
Also, as a minor tweak, put cmake builds to the front
as they complete the most quickly
2019-12-28 14:08:58 +01:00
957d2f1bca [CMake] Add some comments about how to use the file 2019-12-28 13:52:21 +01:00
c07e8c4f80 [CMake] Add support for building shared library and restrict absolute include path to build interface 2019-12-28 13:51:31 +01:00
45d12f199d [CMake/CI] Clone additional transitive dependencies 2019-12-28 12:50:47 +01:00
634fa6847e [CMake/CI] Add basic cmake run to travis 2019-12-28 12:50:36 +01:00
7ec82a06d4 [CI] Enable travis script to run with other branches than master or develop 2019-12-28 12:50:36 +01:00
e54e8e0173 [CMake] Disable autolink for regex 2019-12-28 12:50:36 +01:00
bb0c610591 [CMake] Add option for compilation with ICU support 2019-12-08 16:21:39 +01:00
3d44eca405 [CMake] Add option to build some of the examples 2019-12-08 16:11:45 +01:00
e72490638a [CMake] Add minimal cmake file
Generate cmake target that builds the library and which can
be used by other libraries to express their dependency on
this library and retrieve any configuration information
such as the include directory, binary to link to,
transitive dependencies, necessary compiler options or the
required c++ standards level.
2019-12-08 16:11:45 +01:00
3168641320 Avoid generating pointers in writeable data section.
They increase memory consumption and make exploits
easier and are completely unnecessary.
Avoid them by either avoiding the pointer indirection
completely by using char arrays for strings instead
of char pointers, convert "static" pointer variables
to simple local variables, or mark the array of
pointers as const instead of just the things pointed to.
2019-11-08 11:18:43 +01:00
3d72b06e9d regex_traits_defaults: Do not export arrays only used in same compilation unit.
Exporting variables is unreliable on some platforms including Windows,
and it seems can cause compilation errors in some cases.
Also symbols should not be exported unnecessarily purely on principle.
It would even be possible to move the arrays into the function, but
as they are a bit large that seems to be worse for readability.
2019-11-08 11:11:01 +01:00
0baf08108f Minor spelling fix. 2019-11-05 22:25:11 +01:00
9b6a8e5e82 Point for issues to Github instead of old Trac. 2019-10-08 10:49:01 +02:00
ac03c4fecc Fix gcc -Wdeprecated-copy 2019-03-01 08:36:15 +00:00
10 changed files with 181 additions and 73 deletions

View File

@ -4,18 +4,11 @@
language: cpp
sudo: false
python: "2.7"
os:
- linux
- osx
branches:
only:
- master
- develop
- /feature\/.*/
env:
matrix:
@ -27,6 +20,20 @@ matrix:
- env: BOGUS_JOB=true
include:
- os: linux
env: TEST_CMAKE=true # variables unused - just for identification in travis ci gui
script:
- mkdir __build__ && cd __build__
- cmake .. -DBOOST_ENABLE_CMAKE=ON -DBOOST_INCLUDE_LIBRARIES=regex -DBOOST_REGEX_INCLUDE_EXAMPLES=ON
- cmake --build .
- os: linux
env: TEST_CMAKE=true BUILD_SHARED_LIBS=On # variables unused - just for identification in travis ci gui
script:
- mkdir __build__ && cd __build__
- cmake .. -DBUILD_SHARED_LIBS=ON -DBOOST_ENABLE_CMAKE=ON -DBOOST_INCLUDE_LIBRARIES=regex -DBOOST_REGEX_INCLUDE_EXAMPLES=ON
- cmake --build .
- os: linux
env: TOOLSET=gcc COMPILER=g++ CXXSTD=03
@ -241,60 +248,27 @@ matrix:
- os: osx
env: TOOLSET=clang COMPILER=clang++ CXXSTD=11
osx_image: xcode6.4
# On this image, git doesn't support --jobs 3
install:
- BOOST_BRANCH=develop && [ "$TRAVIS_BRANCH" == "master" ] && BOOST_BRANCH=master || true
- cd ..
- git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
- cd boost-root
- git submodule update --init tools/boostdep
- cp -r $TRAVIS_BUILD_DIR/* libs/regex
- python tools/boostdep/depinst/depinst.py -I example regex
- ./bootstrap.sh
- ./b2 headers
install:
- BOOST_BRANCH=develop && [ "$TRAVIS_BRANCH" == "master" ] && BOOST_BRANCH=master || true
- cd ..
- git clone -b $TRAVIS_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
- git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
- cd boost-root
- git submodule update --init tools/build
- git submodule update --init tools/boost_install
- git submodule update --init libs/headers
- git submodule update --init libs/config
- git submodule update --init libs/core
- git submodule update --init libs/container_hash
- git submodule update --init libs/detail
- git submodule update --init libs/smart_ptr
- git submodule update --init libs/predef
- git submodule update --init libs/assert
- git submodule update --init libs/throw_exception
- git submodule update --init libs/mpl
- git submodule update --init libs/type_traits
- git submodule update --init libs/static_assert
- git submodule update --init libs/integer
- git submodule update --init libs/preprocessor
- git submodule update --init libs/functional
- git submodule update --init libs/program_options
- git submodule update --init libs/chrono
- git submodule update --init libs/system
- git submodule update --init libs/thread
- git submodule update --init libs/winapi
- git submodule update --init libs/move
- git submodule update --init libs/date_time
- git submodule update --init libs/ratio
- git submodule update --init libs/iterator
- git submodule update --init libs/range
- git submodule update --init libs/any
- git submodule update --init libs/concept_check
- git submodule update --init libs/array
- git submodule update --init libs/timer
- git submodule update --init libs/bind
- git submodule update --init libs/utility
- git submodule update --init libs/io
- git submodule update --init libs/intrusive
- git submodule update --init libs/container
- git submodule update --init libs/tuple
- git submodule update --init libs/exception
- git submodule update --init libs/function
- git submodule update --init libs/type_index
- git submodule update --init libs/lexical_cast
- git submodule update --init libs/numeric
- git submodule update --init libs/math
- git submodule update --init libs/tokenizer
- git submodule update --init libs/optional
- git submodule update --init libs/atomic
- git submodule update --init libs/rational
- git submodule update --init libs/algorithm
- git submodule update --init tools/boostdep
- cp -r $TRAVIS_BUILD_DIR/* libs/regex
- python tools/boostdep/depinst/depinst.py -I example -g "--jobs 3" regex
- ./bootstrap.sh
- ./b2 headers

103
CMakeLists.txt Normal file
View File

@ -0,0 +1,103 @@
# Copyright 2018-2019 Mike Dev
# Distributed under the Boost Software License, Version 1.0.
# See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt
#
# NOTE: CMake support for Boost.Regex is currently experimental at best
# and the interface is likely to change in the future
##### How-To:
#
# If you have a cmake project that wants to use and compile
# boost_regex, as part of a single build system run, do the following:
# 1) clone the boost project and all its sub-projects:
#
# git clone --branch develop --depth 1 --recursive --shallow-submodules https://github.com/boostorg/boost.git boost-root
#
# 2) add to your cmake script:
#
# add_subdirectory( <path-to-boost-root> [<build-dir-for-boost-libs>])
# target_link_libraries( <my-exec> PUBLIC Boost::regex)
#
# 3) run your cmake build as usual
#
# ## Explanation:
#
# Currently this file does not work standalone. It is expected to be
# invoked from a parent script via add_subdirectory. That parent script
# is responsible for providing targets for direct and indirect dependencies,
# such as Boost::assert, Boost::concept_check, e.g. by also adding those
# libraries via add_submodule (order doesn't matter).
# The parent script can be your own cmake script, but it is easier to just
# use add the CMakeLists in the root of the boost super project, which
# will in turn add all boost libraries usable with the add_subdirectory
# Workflow.
#
# Note: You don't need to actually clone all boost libraries. E.g. look
# into the travis ci file to see on which libraries boost_regex actually
# depends or use boostdep https://github.com/boostorg/boostdep
##### Current Limitations:
#
# - Doesn't compile or run tests
#
cmake_minimum_required( VERSION 3.5...3.16 )
project( boost_regex VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX )
option( BOOST_REGEX_INCLUDE_EXAMPLES "Also build (some) boost regex examples" OFF )
option( BOOST_REGEX_USE_ICU "Enable ICU support in boost regex" OFF )
file( GLOB BOOST_REGEX_SRC ./src/*.cpp )
add_library( boost_regex ${BOOST_REGEX_SRC} )
add_library( Boost::regex ALIAS boost_regex )
target_include_directories( boost_regex PUBLIC include )
target_compile_definitions( boost_regex
PUBLIC
# No need for autolink
BOOST_REGEX_NO_LIB
$<$<STREQUAL:$<TARGET_PROPERTY:boost_regex,TYPE>,SHARED_LIBRARY>:BOOST_REGEX_DYN_LINK=1>
$<$<STREQUAL:$<TARGET_PROPERTY:boost_regex,TYPE>,STATIC_LIBRARY>:BOOST_REGEX_STATIC_LINK=1>
)
# Specify dependencies (including header-only libraries)
target_link_libraries( boost_regex
PUBLIC
Boost::assert
Boost::concept_check
Boost::config
Boost::container_hash
Boost::core
Boost::integer
Boost::iterator
Boost::mpl
Boost::predef
Boost::smart_ptr
Boost::static_assert
Boost::throw_exception
Boost::type_traits
)
if( BOOST_REGEX_USE_ICU )
# ICU Targets could be provided by parent project,
# if not, look for them ourselves
if( NOT TARGET ICU::dt )
# components need to be listed explicitly
find_package( ICU COMPONENTS dt in uc REQUIRED )
endif()
target_link_libraries( boost_regex
PRIVATE
ICU::dt ICU::in ICU::uc
)
target_compile_definitions( boost_regex PRIVATE BOOST_HAS_ICU=1 )
endif()
if( BOOST_REGEX_INCLUDE_EXAMPLES )
add_subdirectory( example/snippets )
endif()

View File

@ -116,7 +116,7 @@ if ! $(disable-icu)
}
unit-test has_icu : has_icu_test.cpp : $(ICU_OPTS) ;
exe has_icu : has_icu_test.cpp : $(ICU_OPTS) ;
explicit has_icu ;
alias icu_options : : : : [ check-target-builds has_icu : $(ICU_OPTS) : ] ;

View File

@ -8,12 +8,11 @@
[section:history History]
New issues should be submitted at [@http://svn.boost.org svn.boost.org] - don't forget to include your
email address in the ticket!
New issues should be submitted at [@https://github.com/boostorg/regex/issues https://github.com/boostorg/regex/issues]
Currently open issues can be viewed [@https://svn.boost.org/trac/boost/query?status=assigned&status=new&status=reopened&component=regex&order=priority&col=id&col=summary&col=status&col=type&col=milestone&col=component here].
Currently open issues can be viewed [@https://github.com/boostorg/regex/issues?q=is%3Aopen+is%3Aissue here].
All issues including closed ones can be viewed [@https://svn.boost.org/trac/boost/query?status=assigned&status=closed&status=new&status=reopened&component=regex&order=priority&col=id&col=summary&col=status&col=type&col=milestone&col=component here].
All issues including closed ones can be viewed [@https://github.com/boostorg/regex/issues?q=is%3Aissue+is%3Aclosed here].
[h4 Boost.Regex-5.1.4 (Boost-172.0)]

View File

@ -0,0 +1,30 @@
# Copyright 2019 Mike Dev
# Distributed under the Boost Software License, Version 1.0.
# See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt
#
# NOTE: CMake support for Boost.Regex is currently experimental at best
# and we are currently only building a few examples
set(examples
partial_regex_grep
partial_regex_iterate
partial_regex_match
regex_grep_example_1
regex_grep_example_2
regex_grep_example_3
regex_grep_example_4
regex_iterator_example
regex_match_example
regex_merge_example
regex_replace_example
regex_search_example
regex_split_example_1
regex_split_example_2
regex_token_iterator_eg_1
regex_token_iterator_eg_2
)
foreach( example IN LISTS examples )
add_executable( boost_regex_ex_${example} ${example}.cpp )
target_link_libraries( boost_regex_ex_${example} Boost::regex )
endforeach()

View File

@ -859,7 +859,7 @@ escape_type_class_jump:
{
bool have_brace = false;
bool negative = false;
static const char* incomplete_message = "Incomplete \\g escape found.";
static const char incomplete_message[] = "Incomplete \\g escape found.";
if(++m_position == m_end)
{
fail(regex_constants::error_escape, m_position - m_base, incomplete_message);
@ -1133,7 +1133,7 @@ bool basic_regex_parser<charT, traits>::parse_repeat(std::size_t low, std::size_
template <class charT, class traits>
bool basic_regex_parser<charT, traits>::parse_repeat_range(bool isbasic)
{
static const char* incomplete_message = "Missing } in quantified repetition.";
static const char incomplete_message[] = "Missing } in quantified repetition.";
//
// parse a repeat-range:
//
@ -1339,7 +1339,7 @@ bool basic_regex_parser<charT, traits>::parse_alt()
template <class charT, class traits>
bool basic_regex_parser<charT, traits>::parse_set()
{
static const char* incomplete_message = "Character set declaration starting with [ terminated prematurely - either no ] was found or the set had no content.";
static const char incomplete_message[] = "Character set declaration starting with [ terminated prematurely - either no ] was found or the set had no content.";
++m_position;
if(m_position == m_end)
{
@ -1431,7 +1431,7 @@ bool basic_regex_parser<charT, traits>::parse_set()
template <class charT, class traits>
bool basic_regex_parser<charT, traits>::parse_inner_set(basic_char_set<charT, traits>& char_set)
{
static const char* incomplete_message = "Character class declaration starting with [ terminated prematurely - either no ] was found or the set had no content.";
static const char incomplete_message[] = "Character class declaration starting with [ terminated prematurely - either no ] was found or the set had no content.";
//
// we have either a character class [:name:]
// a collating element [.name.]

View File

@ -50,6 +50,8 @@ class regex_iterator_implementation
public:
regex_iterator_implementation(const regex_type* p, BidirectionalIterator last, match_flag_type f)
: base(), end(last), re(*p), flags(f){}
regex_iterator_implementation(const regex_iterator_implementation& other)
:what(other.what), base(other.base), end(other.end), re(other.re), flags(other.flags){}
bool init(BidirectionalIterator first)
{
base = first;

View File

@ -141,7 +141,7 @@ inline bool is_separator<char>(char c)
BOOST_REGEX_DECL std::string BOOST_REGEX_CALL lookup_default_collate_name(const std::string& name);
//
// get the state_id of a character clasification, the individual
// get the state_id of a character classification, the individual
// traits classes then transform that state_id into a bitmask:
//
template <class charT>
@ -208,8 +208,8 @@ int get_default_class_id(const charT* p1, const charT* p2)
{data+63, data+67,}, // word
{data+67, data+73,}, // xdigit
};
static const character_pointer_range<charT>* ranges_begin = ranges;
static const character_pointer_range<charT>* ranges_end = ranges + (sizeof(ranges)/sizeof(ranges[0]));
const character_pointer_range<charT>* ranges_begin = ranges;
const character_pointer_range<charT>* ranges_end = ranges + (sizeof(ranges)/sizeof(ranges[0]));
character_pointer_range<charT> t = { p1, p2, };
const character_pointer_range<charT>* p = std::lower_bound(ranges_begin, ranges_end, t);

View File

@ -354,8 +354,8 @@ icu_regex_traits::char_class_type icu_regex_traits::lookup_icu_mask(const ::UCha
};
static const BOOST_REGEX_DETAIL_NS::character_pointer_range< ::UChar32>* ranges_begin = range_data;
static const BOOST_REGEX_DETAIL_NS::character_pointer_range< ::UChar32>* ranges_end = range_data + (sizeof(range_data)/sizeof(range_data[0]));
const BOOST_REGEX_DETAIL_NS::character_pointer_range< ::UChar32>* ranges_begin = range_data;
const BOOST_REGEX_DETAIL_NS::character_pointer_range< ::UChar32>* ranges_end = range_data + (sizeof(range_data)/sizeof(range_data[0]));
BOOST_REGEX_DETAIL_NS::character_pointer_range< ::UChar32> t = { p1, p2, };
const BOOST_REGEX_DETAIL_NS::character_pointer_range< ::UChar32>* p = std::lower_bound(ranges_begin, ranges_end, t);

View File

@ -193,7 +193,7 @@ BOOST_REGEX_DECL bool BOOST_REGEX_CALL is_combining_implementation(boost::uint_l
//
// these are the POSIX collating names:
//
BOOST_REGEX_DECL const char* def_coll_names[] = {
static const char* def_coll_names[] = {
"NUL", "SOH", "STX", "ETX", "EOT", "ENQ", "ACK", "alert", "backspace", "tab", "newline",
"vertical-tab", "form-feed", "carriage-return", "SO", "SI", "DLE", "DC1", "DC2", "DC3", "DC4", "NAK",
"SYN", "ETB", "CAN", "EM", "SUB", "ESC", "IS4", "IS3", "IS2", "IS1", "space", "exclamation-mark",
@ -214,7 +214,7 @@ BOOST_REGEX_DECL const char* def_coll_names[] = {
// little more - but this will have to do for
// now:
BOOST_REGEX_DECL const char* def_multi_coll[] = {
static const char* def_multi_coll[] = {
"ae",
"Ae",
"AE",