File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -154,28 +154,30 @@ auto get_type_name_impl(const char *ptr, std::index_sequence<Ns...>) {
154
154
return str;
155
155
}
156
156
157
+
158
+ #if defined(__clang__)
157
159
constexpr bool const_strncmp (const char * a, const char *b, uint8_t n)
158
160
{
159
- bool retval = 1 ;
160
-
161
+ bool retval = false ;
161
162
for (uint8_t i = 0 ; i<n; i++)
162
163
{
163
164
if (a[i] != b[i])
164
165
{
165
- retval = 0 ;
166
+ retval = true ;
166
167
break ;
167
168
}
168
169
}
169
170
return retval;
170
171
}
172
+ #endif
171
173
172
174
template <class T >
173
175
const char *get_type_name () {
174
176
175
177
#if defined(__clang__)
176
178
constexpr char opt1[] = " const char *testing::v1::detail::get_type_name() [T = " ;
177
179
constexpr char opt2[] = " const char *testing::detail::get_type_name() [T = " ;
178
- constexpr uint16_t offset = const_strncmp (__PRETTY_FUNCTION__, opt1, sizeof (opt1)-1 )? sizeof (opt1 )-1 : sizeof (opt2 )-1 ;
180
+ constexpr uint16_t offset = const_strncmp (__PRETTY_FUNCTION__, opt1, sizeof (opt1)-1 )? sizeof (opt2 )-1 : sizeof (opt1 )-1 ;
179
181
#elif defined(__GNUC__)
180
182
constexpr uint16_t offset = sizeof (" const char* testing::v1::detail::get_type_name() [with T = " ) - 1 ;
181
183
#endif
You can’t perform that action at this time.
0 commit comments