Andrew Geissler | 0903674 | 2021-06-25 14:25:14 -0500 | [diff] [blame] | 1 | From 6064875bff2e52ba63f01911eb4deb79259c5e3b Mon Sep 17 00:00:00 2001 |
| 2 | From: Carlos Miguel Ferreira <carlosmf.pt@gmail.com> |
| 3 | Date: Thu, 3 Jun 2021 23:10:37 +0100 |
| 4 | Subject: [PATCH] Fixes wrong type for mutex in regex v5 |
| 5 | |
| 6 | With the Boost.Regex to ehader-only library, the declaration |
| 7 | of a mutex that should have been changed from boost::static_mutex |
| 8 | to std::mutex was left behind. This was preventing regex from |
| 9 | being built for older arm platforms [1] |
| 10 | |
| 11 | [1]: https://github.com/openwrt/packages/issues/15725 |
| 12 | |
| 13 | Upstream-Status: Submitted [https://github.com/boostorg/regex/pull/132] |
| 14 | |
| 15 | Signed-off-by: Carlos Miguel Ferreira <carlosmf.pt@gmail.com> |
| 16 | Signed-off-by: Mingli Yu <mingli.yu@windriver.com> |
| 17 | --- |
| 18 | boost/regex/v5/mem_block_cache.hpp | 12 ++++-------- |
| 19 | 1 file changed, 4 insertions(+), 8 deletions(-) |
| 20 | |
| 21 | diff --git a/boost/regex/v5/mem_block_cache.hpp b/boost/regex/v5/mem_block_cache.hpp |
| 22 | index 0af4eae1..eb3ec776 100644 |
| 23 | --- a/boost/regex/v5/mem_block_cache.hpp |
| 24 | +++ b/boost/regex/v5/mem_block_cache.hpp |
| 25 | @@ -85,10 +85,10 @@ struct mem_block_node |
| 26 | struct mem_block_cache |
| 27 | { |
| 28 | // this member has to be statically initialsed: |
| 29 | - mem_block_node* next; |
| 30 | - unsigned cached_blocks; |
| 31 | + mem_block_node* next { nullptr }; |
| 32 | + unsigned cached_blocks { 0 }; |
| 33 | #ifdef BOOST_HAS_THREADS |
| 34 | - boost::static_mutex mut; |
| 35 | + std::mutex mut; |
| 36 | #endif |
| 37 | |
| 38 | ~mem_block_cache() |
| 39 | @@ -133,11 +133,7 @@ struct mem_block_cache |
| 40 | } |
| 41 | static mem_block_cache& instance() |
| 42 | { |
| 43 | -#ifdef BOOST_HAS_THREADS |
| 44 | - static mem_block_cache block_cache = { 0, 0, BOOST_STATIC_MUTEX_INIT, }; |
| 45 | -#else |
| 46 | - static mem_block_cache block_cache = { 0, 0, }; |
| 47 | -#endif |
| 48 | + static mem_block_cache block_cache; |
| 49 | return block_cache; |
| 50 | } |
| 51 | }; |
| 52 | -- |
| 53 | 2.29.2 |
| 54 | |