summaryrefslogtreecommitdiff
path: root/dev-cpp/libcutl/files/libcutl-1.10.0-boost-1.65-tr1.patch
blob: ebb15ee9b40467d9d87137d49cb465e574cbc70d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
Use regex from C++11 instead of boost/tr1's version (the latter is gone as of boost 1.65).
Patch: https://svnweb.freebsd.org/ports/head/devel/libcutl/files/patch-cutl_re_re.cxx?view=markup&pathrev=445764
Bug: https://bugs.gentoo.org/show_bug.cgi?id=630016

--- a/cutl/re/re.cxx
+++ b/cutl/re/re.cxx
@@ -9,7 +9,7 @@
 #ifndef LIBCUTL_EXTERNAL_BOOST
 #  include <cutl/details/boost/tr1/regex.hpp>
 #else
-#  include <boost/tr1/regex.hpp>
+#  include <regex>
 #endif
 
 using namespace std;
@@ -40,17 +40,17 @@
     struct basic_regex<C>::impl
     {
       typedef basic_string<C> string_type;
-      typedef tr1::basic_regex<C> regex_type;
+      typedef std::basic_regex<C> regex_type;
       typedef typename regex_type::flag_type flag_type;
 
       impl () {}
       impl (regex_type const& r): r (r) {}
       impl (string_type const& s, bool icase)
       {
-        flag_type f (tr1::regex_constants::ECMAScript);
+        flag_type f (std::regex_constants::ECMAScript);
 
         if (icase)
-          f |= tr1::regex_constants::icase;
+          f |= std::regex_constants::icase;
 
         r.assign (s, f);
       }
@@ -118,15 +118,15 @@
           impl_ = s == 0 ? new impl : new impl (*s, icase);
         else
         {
-          impl::flag_type f (tr1::regex_constants::ECMAScript);
+          impl::flag_type f (std::regex_constants::ECMAScript);
 
           if (icase)
-            f |= tr1::regex_constants::icase;
+            f |= std::regex_constants::icase;
 
           impl_->r.assign (*s, f);
         }
       }
-      catch (tr1::regex_error const& e)
+      catch (std::regex_error const& e)
       {
         throw basic_format<char> (s == 0 ? "" : *s, e.what ());
       }
@@ -146,15 +146,15 @@
           impl_ = s == 0 ? new impl : new impl (*s, icase);
         else
         {
-          impl::flag_type f (tr1::regex_constants::ECMAScript);
+          impl::flag_type f (std::regex_constants::ECMAScript);
 
           if (icase)
-            f |= tr1::regex_constants::icase;
+            f |= std::regex_constants::icase;
 
           impl_->r.assign (*s, f);
         }
       }
-      catch (tr1::regex_error const& e)
+      catch (std::regex_error const& e)
       {
         throw basic_format<wchar_t> (s == 0 ? L"" : *s, e.what ());
       }
@@ -166,28 +166,28 @@
     bool basic_regex<char>::
     match (string_type const& s) const
     {
-      return tr1::regex_match (s, impl_->r);
+      return std::regex_match (s, impl_->r);
     }
 
     template <>
     bool basic_regex<wchar_t>::
     match (string_type const& s) const
     {
-      return tr1::regex_match (s, impl_->r);
+      return std::regex_match (s, impl_->r);
     }
 
     template <>
     bool basic_regex<char>::
     search (string_type const& s) const
     {
-      return tr1::regex_search (s, impl_->r);
+      return std::regex_search (s, impl_->r);
     }
 
     template <>
     bool basic_regex<wchar_t>::
     search (string_type const& s) const
     {
-      return tr1::regex_search (s, impl_->r);
+      return std::regex_search (s, impl_->r);
     }
 
     template <>
@@ -196,13 +196,13 @@
              string_type const& sub,
              bool first_only) const
     {
-      tr1::regex_constants::match_flag_type f (
-        tr1::regex_constants::format_default);
+      std::regex_constants::match_flag_type f (
+        std::regex_constants::format_default);
 
       if (first_only)
-        f |= tr1::regex_constants::format_first_only;
+        f |= std::regex_constants::format_first_only;
 
-      return tr1::regex_replace (s, impl_->r, sub, f);
+      return std::regex_replace (s, impl_->r, sub, f);
     }
 
     template <>
@@ -211,13 +211,13 @@
              string_type const& sub,
              bool first_only) const
     {
-      tr1::regex_constants::match_flag_type f (
-        tr1::regex_constants::format_default);
+      std::regex_constants::match_flag_type f (
+        std::regex_constants::format_default);
 
       if (first_only)
-        f |= tr1::regex_constants::format_first_only;
+        f |= std::regex_constants::format_first_only;
 
-      return tr1::regex_replace (s, impl_->r, sub, f);
+      return std::regex_replace (s, impl_->r, sub, f);
     }
   }
 }
--- a/m4/libboost.m4
+++ b/m4/libboost.m4
@@ -129,13 +129,13 @@
 AC_DEFUN([LIBBOOST_REGEX], [
 LIBBOOST_LIB([regex],[
 AC_LANG_SOURCE([
-#include <boost/tr1/regex.hpp>
+#include <regex>
 
 int
 main ()
 {
-  std::tr1::regex r ("te.t", std::tr1::regex_constants::ECMAScript);
-  return std::tr1::regex_match ("test", r) ? 0 : 1;
+  std::regex r ("te.t", std::regex_constants::ECMAScript);
+  return std::regex_match ("test", r) ? 0 : 1;
 }
 ])],
 [$1],