Skip to content

Commit e325f49

Browse files
cola119RafaelGSS
authored andcommitted
tools: update inspector_protocol to 2f51e05
PR-URL: #51293 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 60d8048 commit e325f49

File tree

1 file changed

+7
-47
lines changed

1 file changed

+7
-47
lines changed

tools/inspector_protocol/lib/Maybe_h.template

+7-47
Original file line numberDiff line numberDiff line change
@@ -7,41 +7,6 @@
77
#ifndef {{"_".join(config.protocol.namespace)}}_Maybe_h
88
#define {{"_".join(config.protocol.namespace)}}_Maybe_h
99

10-
// This macro allows to test for the version of the GNU C++ compiler.
11-
// Note that this also applies to compilers that masquerade as GCC,
12-
// for example clang and the Intel C++ compiler for Linux.
13-
// Use like:
14-
// #if IP_GNUC_PREREQ(4, 3, 1)
15-
// ...
16-
// #endif
17-
#if defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__)
18-
#define IP_GNUC_PREREQ(major, minor, patchlevel) \
19-
((__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= \
20-
((major)*10000 + (minor)*100 + (patchlevel)))
21-
#elif defined(__GNUC__) && defined(__GNUC_MINOR__)
22-
#define IP_GNUC_PREREQ(major, minor, patchlevel) \
23-
((__GNUC__ * 10000 + __GNUC_MINOR__ * 100) >= \
24-
((major)*10000 + (minor)*100 + (patchlevel)))
25-
#else
26-
#define IP_GNUC_PREREQ(major, minor, patchlevel) 0
27-
#endif
28-
29-
#if defined(__mips64)
30-
#define IP_TARGET_ARCH_MIPS64 1
31-
#elif defined(__MIPSEB__) || defined(__MIPSEL__)
32-
#define IP_TARGET_ARCH_MIPS 1
33-
#endif
34-
35-
// Allowing the use of noexcept by removing the keyword on older compilers that
36-
// do not support adding noexcept to default members.
37-
#if ((IP_GNUC_PREREQ(4, 9, 0) && !defined(IP_TARGET_ARCH_MIPS) && \
38-
!defined(IP_TARGET_ARCH_MIPS64)) || \
39-
(defined(__clang__) && __cplusplus > 201300L))
40-
#define IP_NOEXCEPT noexcept
41-
#else
42-
#define IP_NOEXCEPT
43-
#endif
44-
4510
//#include "Forward.h"
4611

4712
{% for namespace in config.protocol.namespace %}
@@ -53,7 +18,7 @@ class Maybe {
5318
public:
5419
Maybe() : m_value() { }
5520
Maybe(std::unique_ptr<T> value) : m_value(std::move(value)) { }
56-
Maybe(Maybe&& other) IP_NOEXCEPT : m_value(std::move(other.m_value)) {}
21+
Maybe(Maybe&& other) noexcept : m_value(std::move(other.m_value)) {}
5722
void operator=(std::unique_ptr<T> value) { m_value = std::move(value); }
5823
T* fromJust() const { DCHECK(m_value); return m_value.get(); }
5924
T* fromMaybe(T* defaultValue) const { return m_value ? m_value.get() : defaultValue; }
@@ -68,7 +33,7 @@ class MaybeBase {
6833
public:
6934
MaybeBase() : m_isJust(false) { }
7035
MaybeBase(T value) : m_isJust(true), m_value(value) { }
71-
MaybeBase(MaybeBase&& other) IP_NOEXCEPT
36+
MaybeBase(MaybeBase&& other) noexcept
7237
: m_isJust(other.m_isJust),
7338
m_value(std::move(other.m_value)) {}
7439
void operator=(T value) { m_value = value; m_isJust = true; }
@@ -87,7 +52,7 @@ class Maybe<bool> : public MaybeBase<bool> {
8752
public:
8853
Maybe() { m_value = false; }
8954
Maybe(bool value) : MaybeBase(value) { }
90-
Maybe(Maybe&& other) IP_NOEXCEPT : MaybeBase(std::move(other)) {}
55+
Maybe(Maybe&& other) noexcept : MaybeBase(std::move(other)) {}
9156
using MaybeBase::operator=;
9257
};
9358

@@ -96,7 +61,7 @@ class Maybe<int> : public MaybeBase<int> {
9661
public:
9762
Maybe() { m_value = 0; }
9863
Maybe(int value) : MaybeBase(value) { }
99-
Maybe(Maybe&& other) IP_NOEXCEPT : MaybeBase(std::move(other)) {}
64+
Maybe(Maybe&& other) noexcept : MaybeBase(std::move(other)) {}
10065
using MaybeBase::operator=;
10166
};
10267

@@ -105,7 +70,7 @@ class Maybe<double> : public MaybeBase<double> {
10570
public:
10671
Maybe() { m_value = 0; }
10772
Maybe(double value) : MaybeBase(value) { }
108-
Maybe(Maybe&& other) IP_NOEXCEPT : MaybeBase(std::move(other)) {}
73+
Maybe(Maybe&& other) noexcept : MaybeBase(std::move(other)) {}
10974
using MaybeBase::operator=;
11075
};
11176

@@ -114,7 +79,7 @@ class Maybe<String> : public MaybeBase<String> {
11479
public:
11580
Maybe() { }
11681
Maybe(const String& value) : MaybeBase(value) { }
117-
Maybe(Maybe&& other) IP_NOEXCEPT : MaybeBase(std::move(other)) {}
82+
Maybe(Maybe&& other) noexcept : MaybeBase(std::move(other)) {}
11883
using MaybeBase::operator=;
11984
};
12085

@@ -123,17 +88,12 @@ class Maybe<Binary> : public MaybeBase<Binary> {
12388
public:
12489
Maybe() { }
12590
Maybe(Binary value) : MaybeBase(value) { }
126-
Maybe(Maybe&& other) IP_NOEXCEPT : MaybeBase(std::move(other)) {}
91+
Maybe(Maybe&& other) noexcept : MaybeBase(std::move(other)) {}
12792
using MaybeBase::operator=;
12893
};
12994

13095
{% for namespace in config.protocol.namespace %}
13196
} // namespace {{namespace}}
13297
{% endfor %}
13398

134-
#undef IP_GNUC_PREREQ
135-
#undef IP_TARGET_ARCH_MIPS64
136-
#undef IP_TARGET_ARCH_MIPS
137-
#undef IP_NOEXCEPT
138-
13999
#endif // !defined({{"_".join(config.protocol.namespace)}}_Maybe_h)

0 commit comments

Comments
 (0)