Line 0
Link Here
|
|
|
1 |
--- memory/mozalloc/throw_gcc.h.orig 2016-07-25 20:22:04 UTC |
2 |
+++ memory/mozalloc/throw_gcc.h |
3 |
@@ -19,104 +19,112 @@ |
4 |
|
5 |
#include "mozilla/mozalloc_abort.h" |
6 |
|
7 |
+#if defined(__clang__) && \ |
8 |
+ defined(_LIBCPP_VERSION) && _LIBCPP_VERSION >= 4000 && \ |
9 |
+ defined(__has_feature) && __has_feature(cxx_attributes) |
10 |
+# define MOZ_NORETURN_CXX11 [[noreturn]] |
11 |
+#else |
12 |
+# define MOZ_NORETURN_CXX11 |
13 |
+#endif |
14 |
+ |
15 |
namespace std { |
16 |
|
17 |
// NB: user code is not supposed to touch the std:: namespace. We're |
18 |
// doing this after careful review because we want to define our own |
19 |
// exception throwing semantics. Don't try this at home! |
20 |
|
21 |
-MOZ_EXPORT MOZ_NORETURN MOZ_ALWAYS_INLINE void |
22 |
+MOZ_NORETURN_CXX11 MOZ_EXPORT MOZ_NORETURN MOZ_ALWAYS_INLINE void |
23 |
__throw_bad_exception(void) |
24 |
{ |
25 |
mozalloc_abort("fatal: STL threw bad_exception"); |
26 |
} |
27 |
|
28 |
-MOZ_EXPORT MOZ_NORETURN MOZ_ALWAYS_INLINE void |
29 |
+MOZ_NORETURN_CXX11 MOZ_EXPORT MOZ_NORETURN MOZ_ALWAYS_INLINE void |
30 |
__throw_bad_alloc(void) |
31 |
{ |
32 |
mozalloc_abort("fatal: STL threw bad_alloc"); |
33 |
} |
34 |
|
35 |
-MOZ_EXPORT MOZ_NORETURN MOZ_ALWAYS_INLINE void |
36 |
+MOZ_NORETURN_CXX11 MOZ_EXPORT MOZ_NORETURN MOZ_ALWAYS_INLINE void |
37 |
__throw_bad_cast(void) |
38 |
{ |
39 |
mozalloc_abort("fatal: STL threw bad_cast"); |
40 |
} |
41 |
|
42 |
-MOZ_EXPORT MOZ_NORETURN MOZ_ALWAYS_INLINE void |
43 |
+MOZ_NORETURN_CXX11 MOZ_EXPORT MOZ_NORETURN MOZ_ALWAYS_INLINE void |
44 |
__throw_bad_typeid(void) |
45 |
{ |
46 |
mozalloc_abort("fatal: STL threw bad_typeid"); |
47 |
} |
48 |
|
49 |
// used by <functional> |
50 |
-MOZ_EXPORT MOZ_NORETURN MOZ_ALWAYS_INLINE void |
51 |
+MOZ_NORETURN_CXX11 MOZ_EXPORT MOZ_NORETURN MOZ_ALWAYS_INLINE void |
52 |
__throw_bad_function_call(void) |
53 |
{ |
54 |
mozalloc_abort("fatal: STL threw bad_function_call"); |
55 |
} |
56 |
|
57 |
-MOZ_EXPORT MOZ_NORETURN MOZ_ALWAYS_INLINE void |
58 |
+MOZ_NORETURN_CXX11 MOZ_EXPORT MOZ_NORETURN MOZ_ALWAYS_INLINE void |
59 |
__throw_logic_error(const char* msg) |
60 |
{ |
61 |
mozalloc_abort(msg); |
62 |
} |
63 |
|
64 |
-MOZ_EXPORT MOZ_NORETURN MOZ_ALWAYS_INLINE void |
65 |
+MOZ_NORETURN_CXX11 MOZ_EXPORT MOZ_NORETURN MOZ_ALWAYS_INLINE void |
66 |
__throw_domain_error(const char* msg) |
67 |
{ |
68 |
mozalloc_abort(msg); |
69 |
} |
70 |
|
71 |
-MOZ_EXPORT MOZ_NORETURN MOZ_ALWAYS_INLINE void |
72 |
+MOZ_NORETURN_CXX11 MOZ_EXPORT MOZ_NORETURN MOZ_ALWAYS_INLINE void |
73 |
__throw_invalid_argument(const char* msg) |
74 |
{ |
75 |
mozalloc_abort(msg); |
76 |
} |
77 |
|
78 |
-MOZ_EXPORT MOZ_NORETURN MOZ_ALWAYS_INLINE void |
79 |
+MOZ_NORETURN_CXX11 MOZ_EXPORT MOZ_NORETURN MOZ_ALWAYS_INLINE void |
80 |
__throw_length_error(const char* msg) |
81 |
{ |
82 |
mozalloc_abort(msg); |
83 |
} |
84 |
|
85 |
-MOZ_EXPORT MOZ_NORETURN MOZ_ALWAYS_INLINE void |
86 |
+MOZ_NORETURN_CXX11 MOZ_EXPORT MOZ_NORETURN MOZ_ALWAYS_INLINE void |
87 |
__throw_out_of_range(const char* msg) |
88 |
{ |
89 |
mozalloc_abort(msg); |
90 |
} |
91 |
|
92 |
-MOZ_EXPORT MOZ_NORETURN MOZ_ALWAYS_INLINE void |
93 |
+MOZ_NORETURN_CXX11 MOZ_EXPORT MOZ_NORETURN MOZ_ALWAYS_INLINE void |
94 |
__throw_runtime_error(const char* msg) |
95 |
{ |
96 |
mozalloc_abort(msg); |
97 |
} |
98 |
|
99 |
-MOZ_EXPORT MOZ_NORETURN MOZ_ALWAYS_INLINE void |
100 |
+MOZ_NORETURN_CXX11 MOZ_EXPORT MOZ_NORETURN MOZ_ALWAYS_INLINE void |
101 |
__throw_range_error(const char* msg) |
102 |
{ |
103 |
mozalloc_abort(msg); |
104 |
} |
105 |
|
106 |
-MOZ_EXPORT MOZ_NORETURN MOZ_ALWAYS_INLINE void |
107 |
+MOZ_NORETURN_CXX11 MOZ_EXPORT MOZ_NORETURN MOZ_ALWAYS_INLINE void |
108 |
__throw_overflow_error(const char* msg) |
109 |
{ |
110 |
mozalloc_abort(msg); |
111 |
} |
112 |
|
113 |
-MOZ_EXPORT MOZ_NORETURN MOZ_ALWAYS_INLINE void |
114 |
+MOZ_NORETURN_CXX11 MOZ_EXPORT MOZ_NORETURN MOZ_ALWAYS_INLINE void |
115 |
__throw_underflow_error(const char* msg) |
116 |
{ |
117 |
mozalloc_abort(msg); |
118 |
} |
119 |
|
120 |
-MOZ_EXPORT MOZ_NORETURN MOZ_ALWAYS_INLINE void |
121 |
+MOZ_NORETURN_CXX11 MOZ_EXPORT MOZ_NORETURN MOZ_ALWAYS_INLINE void |
122 |
__throw_ios_failure(const char* msg) |
123 |
{ |
124 |
mozalloc_abort(msg); |
125 |
} |
126 |
|
127 |
-MOZ_EXPORT MOZ_NORETURN MOZ_ALWAYS_INLINE void |
128 |
+MOZ_NORETURN_CXX11 MOZ_EXPORT MOZ_NORETURN MOZ_ALWAYS_INLINE void |
129 |
__throw_system_error(int err) |
130 |
{ |
131 |
char error[128]; |